Re: gdb - firefox debugging
On Mon, Aug 06, 2007 at 10:43:21PM -0700, J.C. Roberts wrote: I'm looking for all the needed steps to get firefox debug running in gdb. It's my first attempt at this and I've failed to the correct find the mozilla docs (assuming they exist) or details in the misc@, ports@ or tech@ archives. From what I've learned, you're supposed to use the following switches with the /usr/bin/firefox shell script. $ firefox -g You can be more explicit by naming the binary and the debugger. $ firefox -g /usr/local/mozilla-firefox/firefox-bin -d gdb The two are equivalent. Once inside gdb, I know you need to handle some signals. I've tried all combinations of the following signals and handling (nostop etc) without any luck: (gdb) handle SIG32 nostop noprint pass (gdb) handle SIG33 nostop noprint pass (gdb) handle SIGPIPE nostop noprint pass The problem I'm having is the gdb session just stops, without error, and firefox never actually loads. It never stops in the same place twice but it always stops. example (gdb) run lots of output from debug flavor Reading in symbols for nsCSSStyleRule.cpp...done. Reading in symbols for nsJARURI.cpp...done. Reading in symbols for nsReadableUtils.cpp...done. Reading in symbols for nsCSSScanner.cpp...done. Reading in symbols for nsCSSParser.cpp...done. ++DOMWINDOW == 2 Reading in symbols for jsscope.c...done. Reading in symbols for /usr/src/lib/libc/string/strdup.c...done. Reading in symbols for nsTraceRefcntImpl.cpp...done. Reading in symbols for nsXMLDocument.cpp...done. It just sits there like gdb has hit an invisible limit and is waiting for something, and yes, it's sitting in the wait state. (from top) 25200 jcr 100 272M 270M idle wait 0:32 0.00% gdb 16656 jcr 310 7344K 25M stop/0 -0:03 0.00% firefox-bin Reluctantly, I've tried kicking the kern.maxfiles sysctl up as high as 20,000 but that's not the issue (I normally run the default). Just guessing from my previous pleasant experience of debuging firefox: increase ulimit - data to ~ 2GB add swap until you have a total of ~2GB I remember something like gdb alone eating 900MB. Tobias [...]
Re: gdb - firefox debugging
On Tuesday 07 August 2007 1:43:21 am J.C. Roberts wrote: I'm looking for all the needed steps to get firefox debug running in gdb. It's my first attempt at this and I've failed to the correct find the mozilla docs (assuming they exist) or details in the misc@, ports@ or tech@ archives. From what I've learned, you're supposed to use the following switches with the /usr/bin/firefox shell script. $ firefox -g You can be more explicit by naming the binary and the debugger. $ firefox -g /usr/local/mozilla-firefox/firefox-bin -d gdb The two are equivalent. Once inside gdb, I know you need to handle some signals. I've tried all combinations of the following signals and handling (nostop etc) without any luck: (gdb) handle SIG32 nostop noprint pass (gdb) handle SIG33 nostop noprint pass (gdb) handle SIGPIPE nostop noprint pass The problem I'm having is the gdb session just stops, without error, and firefox never actually loads. It never stops in the same place twice but it always stops. Hi, use 'set auto-solib-add off' to stop gdb from loading symbols from all shared libs. then selectively load shared lib symbols with 'shared libname' for placing breakpoints or to get line numbers from 'bt'. this technique is also needed to debug OOo issues. -Kurt
gdb - firefox debugging
I'm looking for all the needed steps to get firefox debug running in gdb. It's my first attempt at this and I've failed to the correct find the mozilla docs (assuming they exist) or details in the misc@, ports@ or tech@ archives. From what I've learned, you're supposed to use the following switches with the /usr/bin/firefox shell script. $ firefox -g You can be more explicit by naming the binary and the debugger. $ firefox -g /usr/local/mozilla-firefox/firefox-bin -d gdb The two are equivalent. Once inside gdb, I know you need to handle some signals. I've tried all combinations of the following signals and handling (nostop etc) without any luck: (gdb) handle SIG32 nostop noprint pass (gdb) handle SIG33 nostop noprint pass (gdb) handle SIGPIPE nostop noprint pass The problem I'm having is the gdb session just stops, without error, and firefox never actually loads. It never stops in the same place twice but it always stops. example (gdb) run lots of output from debug flavor Reading in symbols for nsCSSStyleRule.cpp...done. Reading in symbols for nsJARURI.cpp...done. Reading in symbols for nsReadableUtils.cpp...done. Reading in symbols for nsCSSScanner.cpp...done. Reading in symbols for nsCSSParser.cpp...done. ++DOMWINDOW == 2 Reading in symbols for jsscope.c...done. Reading in symbols for /usr/src/lib/libc/string/strdup.c...done. Reading in symbols for nsTraceRefcntImpl.cpp...done. Reading in symbols for nsXMLDocument.cpp...done. It just sits there like gdb has hit an invisible limit and is waiting for something, and yes, it's sitting in the wait state. (from top) 25200 jcr 100 272M 270M idle wait 0:32 0.00% gdb 16656 jcr 310 7344K 25M stop/0 -0:03 0.00% firefox-bin Reluctantly, I've tried kicking the kern.maxfiles sysctl up as high as 20,000 but that's not the issue (I normally run the default). I'm running 4.1-Stable (updated yesterday). I've tried with both UP and MP kernels. I've tried with both the normal and -debug flavors of the firefox package (2.0.0.3, 2.0.0.4 and my own build of 2.0.0.5). I've tried with a new firefox profile, with no luck. I've tried removing my ~/.gtkrc-2.0 file just in case it was the source of the problem. I've tried running as root just in case it might have been some bizarre permission issue. The problem is not a matter of impatience, since I've let gdb sit there untouched for hours waiting for it to finally load firefox. I've tried both with and without Xinerama enabled, just in case the supposed firefox xinerama superpowers are less super than advertised. In case it's a desktop confilict, I've tried with fvwm, xfce and kde. Sadly, I'm running out of stupid ideas to try, so if you happen to know the right way get firefox running in gdb, puleeese kick the knowledge downstairs to the unwashed. thanks, jcr