Mail Archives: djgpp/1997/03/27/15:20:59
Paul Peavyhouse wrote:
>
> Does anyone know if there are any utilities that will build a
> hierarchy diagram of function calls in a program's source code? The diagram
> should look like a Windows Explorer tree, with "void main(void)" (or whatever)
> at the top (level 0), and ever function called from main would be drawn as a
> node off main with a level of 1, and every function from those functions would
> be drawn as another node off those nodes, etc etc.
The GNU profiler (gprof) is designed to trace the usage of functions in
programs. To this end, it builds up a database containing information
on the number of times each function calls each other function during
program execution. This could probably be used to create such a tree,
if you are willing to take the time. The profiler is described briefly
in the DJGPP FAQ, and is part of the 'v2gnu/bnu27b.zip' package.
You might also want to look at some of the more esoteric 'ld'
command-line switches, such as -M (--print-map), --cref, -Map, etc.,
which are described in the Info docs.
--
John M. Aldrich <fighteer AT cs DOT com>
* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
again.
* It doesn't necessarily do it in chronological order, though.
--- Douglas Adams
- Raw text -