Closed Bug 828078 Opened 9 years ago Closed 9 years ago

JS GDB support: some GDB versions require a dummy type lookup

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jimb, Assigned: jimb)

References

Details

Attachments

(1 file)

In some versions of GDB, debugging some programs, printing JSObject pointers can fail, claiming that there is no type 'js::BaseShape::Flag'. This is a GDB bug, which is fixed in the current GDB sources. Adding a dummy lookup of js::BaseShape before the real lookup fixes the problem.

Here's the symptom, debugging the jsapi-tests executable:

(gdb) b testOOM.cpp:11
Breakpoint 1 at 0x42d7bd: file .../js/src/jsapi-tests/testOOM.cpp, line 11.
(gdb) run testOOM
Starting program: .../js/src/debugroot~/jsapi-tests/jsapi-tests testOOM
testOOM

Python Exception <class 'gdb.error'> No type named js::BaseShape::Flag.: 
Breakpoint 1, cls_testOOM::run (this=0xc6fb20, global=0x7ffff7920060)
    at /home/jimb/moz/dbg/js/src/jsapi-tests/testOOM.cpp:11
(gdb)

What's dumb here is that, if I immediately do a 'ptype js::BaseShape::Flag' command, that will succeed. GDB does know the type; gdb.lookup_type just fails to find it.
Assignee: general → jimb
Status: NEW → ASSIGNED
Attachment #699493 - Flags: review?(sphink)
Attachment #699493 - Flags: review?(sphink) → review+
Duplicate of this bug: 828077
Flags: in-testsuite-
Target Milestone: --- → mozilla21
https://hg.mozilla.org/mozilla-central/rev/274946fd76c4
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.