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.