[mdlug] [Request] (dis)recommendations for gcc function call sequence

David Lane dcl400m at yahoo.com
Tue Jan 29 09:08:43 EST 2008


This would be a roll of the dice, but I think that Kdevelop might have some debug functionality.

David 


----- Original Message ----
From: Robert Meier <list1c30fe42 at bellsouth.net>
To: mdlug at mdlug.org
Sent: Tuesday, January 29, 2008 3:24:35 AM
Subject: [mdlug] [Request] (dis)recommendations for gcc function call sequence


C programmers,

I am trying to map (i.e. determine) the history of function calls in c
 code.
The compiler is gcc-2.96, with associated gdb, gprof, and most other
 tools.
I can generally add any compile/link flags I need,
but cannot practically spend the time to alter the source code.

AFAIK, gprof, (gmon.out format) only collects a histogram (caller
and duration) of calls, and discards the sequence of calls.

What tools do you (dis)recommend?
Is there a (set of) gcc options to record entry/exit of each function?



Example:

static int tak(int x, int y, int z) {
  return x > y ? tak(tak(x-1, y, z),tak(y-1, z, x),tak(z-1, x, y)) : z;
}

I don't expect a human readable record,
but need to be able to trace execution,
similar to the following.

  tak(3,2,1)
    tak(0,3,2)
  2=tak(0,3,2)
    tak(1,1,3)
  3=tak(1,1,3)
    tak(2,2,1)
  1=tak(2,2,1)
   tak(1,3,2)
 2=tak(1,3,2)
2=tak(3,2,1)

TIA,
-- 
Bob

  "A computer once beat me at chess,
   but it was no match for me at kick boxing."
     -- Emo Philips
_______________________________________________
mdlug mailing list
mdlug at mdlug.org
http://mdlug.org/mailman/listinfo/mdlug






      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



More information about the mdlug mailing list