[PATCH] Use external tool for creating backtraces on crashes if available. (v2)

Jon TURNEY jon.turney at dronecode.org.uk
Mon Nov 15 07:33:52 PST 2010


On 08/10/2010 21:43, Alan Coopersmith wrote:
> Matthias Hopf wrote:
>> This calls /usr/bin/xorg-backtrace to create reasonable commented backtraces
>> with gdb. On errors it falls back to the generic method.
> 
> There's already similar code in the backtrace.c file in the
> # ifdef HAVE_PSTACK case, where we fork the external pstack
> process on Solaris to get stack traces that have more information
> than the libc builtins allow, like getting full symbol tables from
> libelf.
> 
> Could we make the fork/exec wrapper common between the two?   I'd
> even be okay with making the entire code in backtrace.c common and
> just letting the script handle calling gdb or pstack.   (Solaris
> systems are more likely to have pstack installed than gdb.)

Attached is an updated version of this patch which uses a common fork/exec
wrapper and looks for the backtrace script in $bindir.

I had to drop the use of fork1() and closefrom() as they aren't portable to my
platform of interest.  Unfortunately,  gdb can't backtrace through a signal
handler on cygwin, so this patch isn't as much use to me as I hoped it might
be, so I'll just leave it here :-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Use-external-tool-for-creating-backtraces-on-crashes.patch
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101115/2f677af3/attachment.ksh>


More information about the xorg-devel mailing list