Re: [GD-Linux] signals and exceptions
Brought to you by:
vexxed72
From: Mads B. D. <ma...@ch...> - 2001-11-16 11:29:31
|
On Fri, 16 Nov 2001, Steve Baker wrote: > (Hmmm: There don't seem to be any 'man' pages for 'backtrace()' > and 'backtrace_symbols()') Bert Freudenberg posted an url to the man pages. Embarrisingly enough the code I posted seems to have an error - I am not freeing the strings. > > Is there any way to get the stack backtrace to show line numbers like > gdb does? Under Linux there are the two programs c++filt (to demangle c++ names) and addr2line which is part of the binutils. I suppose you could use the backtrace function that writes to a file descriptor, or write a script that takes the data as input. Depends on your settings, really. I have no experience under other platforms. Since gdb can do this under all supported platforms (I believe) I suppose there are code in gdb to handle this in an uniform way. One should be able to build a library or similar to link into ones applications to get this kind of information on demand/crashes. (For all I know, such a library may already exist). The above is enough for me at the moment though, so I will leave that to someone else ;-) Mads -- Mads Bondo Dydensborg. ma...@ch... The University of North Carolina has finally found a network server that, although missing for four years, hasn't missed a packet in all that time. Try as they might, university administrators couldn't find the server. Working with Novell Inc. (stock: NOVL), IT workers tracked it down by meticulously following cable until they literally ran into a wall. The server had been mistakenly sealed behind drywall by maintenance workers. - Techweb, 20010409 |