public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* function logging
@ 2002-04-16  8:37 Calin Vatavu
  2002-04-16  9:26 ` Wei Qin
  0 siblings, 1 reply; 2+ messages in thread
From: Calin Vatavu @ 2002-04-16  8:37 UTC (permalink / raw)
  To: gcc-help


I'm trying to log EVERY function call in a library (gtk+ for example) and I 
did it by inserting the line: 

int dummy = printf (" %s %d", __FILE__, __LINE__); 

in ALL functions (at the beginning). I used a perl script which can, 
ofcourse, be fooled in some cases (like enum {...). thus I think I need a 
c-parser which can give me the position of the starting of the function body 
in the file.
Cab gcc give me the access to its internals to accomplish this ? 

And a second problem, how can I know the caller of the current function 
(like the perl's caller() function) ?
I need the backtrace in every function call. 

Does anybody know some debugging tricks like this ? 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-16 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16  8:37 function logging Calin Vatavu
2002-04-16  9:26 ` Wei Qin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).