Install SM pretty printers and catchpoints in debug sessions for browser builds

NEW
Unassigned

Status

()

Core
JavaScript Engine
4 years ago
4 years ago

People

(Reporter: efaust, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
SM has really nice pretty printers for values, and a catchpoint handler for the annoying operations callback stuff that are installed by default when debugging the standalone shell build. It would be nice if that stuff was loaded for browser build debugging, in particular for debug sessions spawned from mach.
Created attachment 8445126 [details]
Example of acceptable segfault in asm.js code

This acts as an example of a case where segfaulting is accepted and can be ignored, on x64 platforms.

Running |./mach debug +slowscript| will block on the segfault, but the user can actually just |continue| and everything will behave well afterwards.
Created attachment 8445132 [details] [diff] [review]
Patch for gdb signal handlers

There was actually a big discussion about this in bug 933807. It seems that now we do have a .gdbinit in the main directory, that's autoloaded when launching the browser with ./mach debug. So this patch just copies what has been done for the js shell: disabling access errors (ACCERR) segfaults, which are the ones used by the JITs.

When running |./mach debug +slowscript| with this patch applied, segfaults are correctly ignored. There are so many that we still need to hit continue sometimes in gdb, but that's the best I could have so far :/

I kind of remember we actually don't want that because of another program that watches segfaults, probably the crash reporter, but I am unsure the crash report would look at the ACCERR segfaults.

Bug 986673 seems to sketch a better long-term fix, but I feel like this patch is better than the current solution (i.e. disabling slow scripts handlers by default).
Andrew, Luke, any opinions on this approach?
Attachment #8445132 - Flags: feedback?(luke)
Attachment #8445132 - Flags: feedback?(bugmail)
Comment on attachment 8445132 [details] [diff] [review]
Patch for gdb signal handlers

Silencing SEGV_ACCERR faults is a bit scary b/c I assume these can come up for other reasons.  bug 986673 sounds like a good route.
Attachment #8445132 - Flags: feedback?(luke)
Comment on attachment 8445132 [details] [diff] [review]
Patch for gdb signal handlers

Clearing feedback field, as bug 986673 is on its way.
Attachment #8445132 - Flags: feedback?(bugmail)
Attachment #8445132 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.