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
On Tue, 2004-06-29 at 05:14, Gerrit BruchhÃuser wrote:
> If I compare these pointers then it looks like:
> === Unwind ==> BFD ==> Symbol
> Function: 0x12002d508 ==> 0x12002d560 ==> main
> Function: 0x12002d544 ==> 0x12002d4dc ==> foo1
> Function: 0x12002d580 ==> 0x12002d524 ==> foo
> How can I combine both the pointer information so that I can printout
> function names instead of addresses in my backtrace? A simple range
> check doesn't seem to do it :-(
addr2line -f is the easy solution.
I think you have the function names wrong in the above list. The
backtrace 0x12002d508 0x12002d544 0x12002d580 is foo1/foo/main. If you
fix that, then a simple range check on function address does work. This
is what addr2line does essentially.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com