Open Bug 1247769 Opened 8 years ago Updated 2 years ago

gdb is confused by nsPIDOMWindowInner/Outer

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

People

(Reporter: khuey, Unassigned)

References

Details

STR:

1. b nsGlobalWindow::RunTimeout
2. wait for a timeout to fire
3. p this->mOuterWindow.mRawPtr
4. p this->mOuterWindow.mRawPtr->mDocShell (this will fail)
5. p ((nsPIDOMWindow<nsISupports>*)this->mOuterWindow.mRawPtr)->mDocShell

Gdb is confused by nsPIDOMWindowOuter here, and doesn't seem to recognize it as a type.  That may be due to https://sourceware.org/bugzilla/show_bug.cgi?id=14093

Is there some sort of pretty printing magic we can do here to hide the needed cast?
Flags: needinfo?(ttromey)
Flags: needinfo?(jimb)
I took a quick look at this.  I think it is most likely a gcc bug.

It seems to me that nsPIDOMWindowOuter ought to exist somewhere in the debug info.

However a dwgrep script to find a non-declaration DIE shows no output:

dwgrep -e 'entry (?TAG_class_type) ?( (@AT_name == "nsPIDOMWindowOuter") !(@AT_declaration == true) )' ./obj-x86_64-unknown-linux-gnu/dist/bin/libxul.so


You can try this with another class (I used nsCSSScannerPosition) to see it working.

gdb generally ignores DW_AT_declaration classes, at least, IIRC, for the purpose of
building symbols and types.

Tomorrow I'll try to find the relevant gcc bug.

I don't think there is a particularly handy workaround.
You could make a convenience function but then you'd end up having to remember
to type it (like "print $_mumble(this->outerWindow)")

The new xmethod support doesn't, afaik, support simple references, just functions.
(I don't know if you could supply a phony operator-> here; maybe worth a try but
I'd be surprised)

Maybe there's some hack that could be done in the source to get gcc to emit a definition.

There's -fno-eliminate-unused-debug-types, but that's pretty heavy.
Flags: needinfo?(ttromey)
Flags: needinfo?(jimb)
This is related but not exactly the same:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12385

I'll file a new gcc bug report with some findings.
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.