GNOME Bugzilla – Bug 711088
gbacktrace: Don't close stderr when running gdb
Last modified: 2013-11-19 13:54:50 UTC
When using g_on_error_stack_trace, if gdb is not present, nothing is printed out. This is because we close stderr before execing gdb. This is not necessary for getting the backtrace.
Created attachment 258462 [details] [review] gbacktrace: Don't close stderr when running gdb We want to see error messages related to starting and running gdb (such as if it's not installed).
Review of attachment 258462 [details] [review]: We're not closing stderr - we're redirecting it to the same pipe as stdout, which does some postprocessing it looks like, then prints it to stdout. With your change, we now leave gdb stderr attached to the process' stderr. I can't say for sure whether this is an important behavioral change or not. However a fix we probably *should* do here is _exit (1), and change the calling code to explicitly print an error in that case.
Created attachment 260202 [details] [review] gbacktrace: Print out gdb exec errors correctly We want to see error messages related to starting and running gdb (such as if it's not installed).
Review of attachment 260202 [details] [review]: Looks good; if our goal is just to get it printed where a developer might see it, this should work.
Attachment 260202 [details] pushed as 6f7d8f6 - gbacktrace: Print out gdb exec errors correctly