GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 19-May-2005, 08:22
bravetanveer bravetanveer is offline
New Member
 
Join Date: Jan 2005
Posts: 11
bravetanveer is on a distinguished road

how to get Call graph for applications, anybody knows


Hi all,

Has someone tried on something like this?

I want to implement a concept.

I want to get a call graph for all functions and loops in an application.
with Call graph i mean which line in source code was executed at a instant of time.

The graph would be listing something like

for:31 for:33 func1
for:33
func1 func2
func2

for:line number

With this call graph we mean
1. for:31 called for:33 and func1
2. for:33 is for loop at line 33 , it is calls no one
3. func1 calls func2

and like that

I had gone through tools such as gprof. But problem is gprof gives call graph at function level not at loop level.

One more solution to it is use of "ptrace" which traces the execution flow of an application.
I am going through articles on ptrace with the hope to find solution for my problem.

If anyone knows about such a thing , do reply

Tanveer
  #2  
Old 29-Sep-2005, 23:27
bravetanveer bravetanveer is offline
New Member
 
Join Date: Jan 2005
Posts: 11
bravetanveer is on a distinguished road

Re: how to get Call graph for applications, anybody knows


No replies, but it is long time, i have added to this thread.

The way to get call graphs is :
1. Reading the disassembly file, and catching on the branch instructions present in that file. It is more of reading the debugging information and from that constructing the call graph.
Very tricky but can be done.

2.
Parsing the .c file
Identifying the block in C code such as loops or function calls.
After each identification, we should insert our own printf statement, on fprintf statement which writes to a file which loop or function was present.

In this case, construction of parser for .c file is difficult task. Once, one is able to idnetify loops and functions, then code insertion is next task.
And we get the call graph.

Please Correct me, in my approach.

Tanveer.
 
 

Recent GIDBlogObservations of Iraq by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulation Problem wu_weidong C++ Forum 7 12-Mar-2005 22:56
how to call OnDraw in another class. kumaran MS Visual C++ / MFC Forum 0 03-Mar-2005 03:02
XML feed into PHP graph Darksat MySQL / PHP Forum 2 27-Sep-2004 09:33
algorithm for display complex graph ctai010 C++ Forum 0 20-Mar-2004 05:24
Phone call from computer mrkamran Computer Hardware Forum 3 21-Feb-2004 13:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:59.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.