Closed Bug 1565621 Opened 5 years ago Closed 5 years ago

Separate out Debugger's external API

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

(Whiteboard: [debugger-mvp])

Attachments

(2 files)

Attached file minimal Debugger.h (deleted) —

Debugger.h is over 2000 lines, but most of it is only used internally. I tried clearing the contents of several debugger-related files (Debugger.cpp, Debugger-inl.h, DebuggerMemory.cpp, UbiNode.cpp, WasmDebug.cpp) and paring down Debugger.h to the structures and interfaces necessary for the rest of spidermonkey to compile --- the Debugger's external API, essentially. Mostly this is ~30 static methods on Debugger, but there are a few places (Zone.cpp, JSScript.cpp, Realm.cpp, SavedStacks.cpp) with methods that to a minor extent dig into the contents of Debugger itself. I commented these out, and was able to get Debugger.h down to 257 lines, which I've attached. Notably absent from this file is any instance data or methods on Debugger.

Where I'd like to go next with this is to create a file, js/src/dbg/DebugAPI.h or something, that encapsulates this API. The static methods on Debugger which are used externally will be moved into a new class in this file, DebugAPI, which is never instantiated and is basically a namespace. Then, Debugger.h (which defines Debugger) would be intended for internal use only, though the files referenced above would need to include it for now. In followup work, those references can be cut by moving the associated code into js/src/dbg, and Debugger.h will not need to be included anywhere outside of js/src/dbg.

More followup work in bug 1564172 and bug 1564174 can tidy this interface up further, but will have a much cleaner place from which to start from.

Blocks: dbg-70
Status: NEW → ASSIGNED
Whiteboard: [debugger-mvp]
Priority: -- → P2
Blocks: 1566885
Pushed by bhackett@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/53929e15ca8a Factor out Debugger's external API into DebugAPI, r=jimb.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: