This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Function, file and line information out of '_Unwind_Context' ptr
- From: Gerrit Bruchhäuser <gbruchhaeuser at orga-systems dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 27 Jun 2004 15:47:49 +0200
- Subject: Re: Function, file and line information out of '_Unwind_Context' ptr
- Organization: ORGA-Systems
- References: <40D6B841.7030908@orga-systems.com> <40DCE02F.5090806@specifixinc.com>
'addr2line' is not available on OSF-Alpha and invoking system call takes a lot
of time. Say it would be also possible to call system on gdb (and my pid) to
retreive a backtrace with file an d line information but this is too slow for
memory leak detection tools.
It would be extremly useful to have a 'Backtrace' like building function in
g++ (as there is in GLIBC) which does work with any platform g++ runs on. I
thought I could use the '_Unwind_Stack' function for this. Is there maybe an
other way to retreive file and line information out of the mentioned
structure pointer??
Thx,
Gerrit
Am Samstag, 26. Juni 2004 04:32 schrieb Jim Wilson:
> Gerrit Bruchhäuser wrote:
> > how can I retreive a backtrace which includes function-name, file and
> > line information on Tr64-OSF-Alpha (glibc is not supported on this
> > platform).
>
> Extract the pc from the context structure, and use system() to call the
> addr2line program from binutils. This assumes the program was compiled
> with debug info.