delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/27/15:20:59

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Function Call Hiearchy Diagram Tool
Date: Wed, 26 Mar 1997 12:35:45 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 31
Message-ID: <333988A1.3312@cs.com>
References: <5hcrgn$l6a AT netra DOT montana DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp108.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019