This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Call Stack (Reflection)
- To: egcs at cygnus dot com
- Subject: Call Stack (Reflection)
- From: Frank Pilhofer <fp at informatik dot uni-frankfurt dot de>
- Date: Sun, 17 Jan 1999 14:56:52 +0100
Hi,
I'd like to have some information/examples of accessing the debugging/
profiling data produced by gcc within the program itself. I'm interested
in writing code that prints a back trace of cleartext function names,
like gdb does. The general idea is, in C++, to overload the new and
delete operators, and to associate each chunk of memory with a back
trace, to check for memory leakage.
After browsing libgcc2.c, it seems that there are already hooks that
generate the necessary information. But from reading the source, I
don't know how to activate, use or evaluate it. In a simple test program,
compiled and linked with -a -pg -g (linux-glibc1), __bb.blocks is always
NULL.
Is there some documentation, or is there some example source that
could help me? Or is there a package that already does what I intend
to do? -- I doubt I'm the first one to think of this possibility.
Frank
--
+ Frank Pilhofer fp@informatik.uni-frankfurt.de +
| http://www.uni-frankfurt.de/~fp/ |
+---- Life would be a very great deal less weird without you. - DA ----+