Re: [GD-Linux] signals and exceptions
Brought to you by:
vexxed72
From: D. S. <st...@id...> - 2001-11-16 05:28:59
|
Steve Baker wrote: > > "D. Stimits" wrote: > > > Would it be possible to see what is in the backtrace() and > > backtrace_symbols() functions? > > They appear to be standard (but undocumented) glibc functions. So I see. > > I just compiled that code snippet as-is and called it from somewhere > deeply nested in my code - and it dumped out the filename, function > name and ugly hex offset into the function for the most recent 32 > functions on the stack! Can you tell me what compiler flags you used? I created a simple program to test this, I used "-Wall -g", but it seems to only give hex offsets: Traced: ./deleteme(__eh_alloc+0x1b2) [0x804896e] Traced: ./deleteme(__eh_alloc+0x2af) [0x8048a6b] Traced: ./deleteme(__eh_alloc+0x299) [0x8048a55] Traced: ./deleteme(__eh_alloc+0x27d) [0x8048a39] Traced: ./deleteme(__eh_alloc+0x261) [0x8048a1d] Traced: ./deleteme(__eh_alloc+0x14c) [0x8048908] Traced: /lib/i686/libc.so.6(__libc_start_main+0x93) [0x400ae177] Traced: ./deleteme(__eh_alloc+0x35) [0x80487f1] My executable was named "deleteme" to remind me to remove it if I forget, so it obviously got the file name right for the executable, but the actual source was "db_display.cpp". All of my function calls are listed in stripped form. Was there something you used to get the name of functions rather than my uglier format? D. Stimits, st...@id... > > It's *magic* :-) > > ----------------------------- Steve Baker ------------------------------- > Mail : <sjb...@ai...> WorkMail: <sj...@li...> > URLs : http://www.sjbaker.org > http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net > http://prettypoly.sf.net http://freeglut.sf.net > http://toobular.sf.net http://lodestone.sf.net |