Skip to content

script: Create a debugger script for the SpiderMonkey Debugger API#38331

Merged
jdm merged 5 commits intomainfrom
debugger-script
Jul 31, 2025
Merged

script: Create a debugger script for the SpiderMonkey Debugger API#38331
jdm merged 5 commits intomainfrom
debugger-script

Conversation

@delan
Copy link
Member

@delan delan commented Jul 29, 2025

to use the SpiderMonkey Debugger API, we need to call it from an internal debugger script that we will supply. this script must run in the same runtime as the debuggee(s), but in a separate compartment (more details).

this patch defines a new DebuggerGlobalScope type and a new debugger script resource. when creating each script thread, we create a debugger global, load the debugger script from resources/debugger.js, and run that script in the global to initialise the Debugger API.

subsequent patches will use the debugger script as an RPC mechanism for the Debugger API.

Testing: no testable effects yet, but will be used in #37667
Fixes: part of #36027

Signed-off-by: Delan Azabani <[email protected]>
@delan delan enabled auto-merge July 31, 2025 01:48
Signed-off-by: Delan Azabani <[email protected]>
@delan delan added this pull request to the merge queue Jul 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 31, 2025
@delan delan enabled auto-merge July 31, 2025 02:50
@delan delan added this pull request to the merge queue Jul 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 31, 2025
@delan delan added this pull request to the merge queue Jul 31, 2025
@delan delan removed this pull request from the merge queue due to a manual request Jul 31, 2025
Signed-off-by: Delan Azabani <[email protected]>
@delan delan requested a review from jschwe as a code owner July 31, 2025 04:41
@delan delan enabled auto-merge July 31, 2025 04:42
@delan delan added this pull request to the merge queue Jul 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 31, 2025
@jdm jdm added this pull request to the merge queue Jul 31, 2025
Merged via the queue into main with commit c09e117 Jul 31, 2025
21 checks passed
@jdm jdm deleted the debugger-script branch July 31, 2025 06:44
delan added a commit that referenced this pull request Jul 31, 2025
…38331) (linux)

{"fail_fast": false, "matrix": [{"name": "Linux", "workflow": "linux", "wpt": false, "profile": "release", "unit_tests": false, "build_libservo": false, "bencher": false, "build_args": "", "wpt_args": "", "number_of_wpt_chunks": 20}]}
minghuaw pushed a commit to minghuaw/servo that referenced this pull request Aug 1, 2025
…ervo#38331)

to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
call it from an internal debugger script that we will supply. this
script must run in the same runtime as the debuggee(s), but in a
separate
[compartment](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Compartments)
([more
details](https://hacks.mozilla.org/2020/03/future-proofing-firefoxs-javascript-debugger-implementation/)).

this patch defines a new DebuggerGlobalScope type and a new debugger
script resource. when creating each script thread, we create a debugger
global, load the debugger script from resources/debugger.js, and run
that script in the global to initialise the Debugger API.

subsequent patches will use the debugger script as an RPC mechanism for
the Debugger API.

Testing: no testable effects yet, but will be used in servo#37667
Fixes: part of servo#36027

---------

Signed-off-by: Delan Azabani <[email protected]>
Co-authored-by: atbrakhi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants