Closed Bug 840319 Opened 9 years ago Closed 9 years ago

JS GDB support: regression tests' breakpoint function unified with other empty functions

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jimb, Unassigned)

Details

Attachments

(1 file)

The file js/src/gdb/gdb-tests.cpp, the driver for the C++ side of the SpiderMonkey GDB support regression tests, includes an empty function named 'breakpoint', which specific test functions call once they have set up state for the Python side of the test to inspect. The regression tests set a breakpoint on 'breakpoint', and then select the calling frame to see the test's prepared state.

When SpiderMonkey is compiled without --enable-debug, without optimization, 'breakpoint' gets unified with many other empty functions from the SpiderMonkey library, such that the tests' breakpoint triggers when any of SM's other empty functions get hit. For example, js/src/ion/IonSpewer.h defines js::ion::CheckLogging to be an empty function if DEBUG is not #defined; that gets unified with js/src/gdb/gdb-tests.cpp's 'breakpoint', and then the JS GDB regression tests find their breakpoint being hit when they don't expect it.

The attached patch adds code that performs a distinctive side effect to 'breakpoint', so that the linker won't unify it with anything else. With this patch, all JS GDB support regression tests pass when SM is built without --enable-debug and without optimization.
Attachment #712662 - Flags: review?(sphink)
Sorry, correction. With this patch, there is still one failure: test-jsid.py. That'll be a different bug.
Attachment #712662 - Flags: review?(sphink) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ed4f90669b5
Status: NEW → ASSIGNED
Flags: in-testsuite+
Target Milestone: --- → mozilla21
https://hg.mozilla.org/mozilla-central/rev/4ed4f90669b5
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.