Monday, July 23, 2007

how to view the JS stack from C++ on the debugger

From C++, I set the breakpoint in the debugger and when I hit the bp, I opened up the QuickWatch window (Debug menu, "QuickWatch" item) and entered:

{,,xpc3250}DumpJSStack()

And clicked on the evaluate button.

On my console window I get:

0 [native frame]
1 [native frame]
2 navigate(aDirection = 1, aPageNum = 0, aHomeOrEnd = 0) ["chrome://global/content/printPreviewBindings.xml":235]
print = [object XPCNativeWrapper [xpconnect wrapped nsIWebBrowserPrint @ 0x5
35f930 (native @ 0x525d148)]]
validInput = false
total = 12
homeOrEnd = undefined
textBoxStr = "1"
newPageNum = 2
this = [object XULElement @ 0x6c4a110 (native @ 0x6616720)]
3 oncommand(event = [object XULCommandEvent @ 0x67d63d0 (native @ 0x67bee6c)]) [
"chrome://browser/content/browser.xul":1]
this = [object XULElement @ 0x6d77f98 (native @ 0x6bc3178)]
4 [native frame]

In Firefox, load chrome://global/content/printPreviewBindings.xml, then do view source, and go to line 235

Thursday, July 12, 2007

NS_BREAK()

NS_BREAK() to launch into the debugger

export XPCOM_DEBUG_BREAK=warn
export XPCOM_DEBUG_BREAK=suspend