https://bugs.freedesktop.org/show_bug.cgi?id=89034
--- Comment #9 from Michel Dänzer michel@daenzer.net --- Alternatively, you can try using a script for gdb's --command option, something like:
set logging on set logging redirect handle SIGPIPE nostop noprint continue bt full continue quit
That should capture the backtrace in a file called gdb.txt. See http://wiki.x.org/wiki/Development/Documentation/ServerDebugging/#index6h2 for more background.