aseigo@linux:~> gdb `which kjots`
GNU gdb 6.1
(gdb) run
Starting program: /opt/kde3/bin/kjots
[New Thread 1096345472 (LWP 26469)]
Program exited normally.
(gdb)
and then the application window will appear. but you won't be able to get a backtrace. notice the "Program exited normally" line, even though the application is still running! what happens is that the real application is forked off of the initial process as part of the "unique application" magic. unfortunately, this makes gdb lose track of the program. the fix is, thankfully, very simple:
(gdb) run --nofork
Starting program: /opt/kde3/bin/kjots --nofork
[New Thread 1096345472 (LWP 27257)]
notice the --nofork parameter, and notice that the application no longer exits immediately. huzzah! backtrace here we come.
now, what if the application just hangs, but doesn't actually crash? you can get a backtrace easily enough by loading it up in gdb and then hitting Ctrl-C. this will interupt the program wherever it is and allow you to ask for a backtrace.

1 comment:
Post a Comment