Recent

Author Topic: Call graph  (Read 1592 times)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8103
Re: Call graph
« Reply #15 on: September 24, 2019, 09:52:46 pm »
valgrind/callgrind?

julkas

  • Hero Member
  • *****
  • Posts: 554
  • KISS principle / Lazarus 2.0.6 / FPC 3.0.4
Re: Call graph
« Reply #16 on: September 25, 2019, 11:14:36 am »
valgrind/callgrind?
Can valgrind/callgrind generate compile time (not run time) call graph/tree ?
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;

Thaddy

  • Hero Member
  • *****
  • Posts: 9809
Re: Call graph
« Reply #17 on: September 25, 2019, 11:23:33 am »
Yes. (just proof)
But there are more than enough dependency scanners.
One of which is the parser and  lexer in the compiler itself. That happens to work....And you have the code... 8-)

fcl-passrc is almost just as good...
« Last Edit: September 25, 2019, 11:32:22 am by Thaddy »
I am more like donkey than shrek

zamtmn

  • Sr. Member
  • ****
  • Posts: 371
Re: Call graph
« Reply #18 on: September 25, 2019, 12:55:17 pm »
No, callgrind works in runtime.
I have not met static analyzers for FPC. Only for delphi, and they don't work with modern FPC

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8103
Re: Call graph
« Reply #19 on: September 25, 2019, 03:35:05 pm »
valgrind/callgrind?
Can valgrind/callgrind generate compile time (not run time) call graph/tree ?

Not that I know, but the initial post didn't mention that constraint.  Lazarus does not really contain much source code metrics tools. Peganza is about the only choice there.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8103
Re: Call graph
« Reply #20 on: September 25, 2019, 03:35:45 pm »
Not a graph, but in the IDE you have: "Find Identifier references" (somewhere in the menu / also in the context menu)
It can find places where a function is called.
With virtual/overriden methods it may not find all....

And or ifdefs...

avra

  • Hero Member
  • *****
  • Posts: 1834
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

julkas

  • Hero Member
  • *****
  • Posts: 554
  • KISS principle / Lazarus 2.0.6 / FPC 3.0.4
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;