Skip to content

Conversation

@andreiltd
Copy link
Member

This enables using content debugger for scripts that don't target wasi/http. Depending on how StarlingMonkey has been configured, maybe_init_debugger can be a nop or perform actual debugger initialization. There is currently a triple line of defense to prevent accidental debugger initialization:

  • StarlingMonkey build must be configured with ENABLE_JS_DEBUGGER=ON
  • StarlingMonkey runtime arguments must include the --enable-script-debugging option
  • The environment variable DEBUGGER_PORT must be defined

This enables using content debugger for scripts that don't target
wasi/http. Depending on how StarlingMonkey has been configured,
`maybe_init_debugger` can be a nop or perform actual debugger
initialization. There is currently a triple line of defense to prevent
accidental debugger initialization:

- StarlingMonkey build must be configured with ENABLE_JS_DEBUGGER=ON
- StarlingMonkey runtime arguments must include the
  `--enable-script-debugging` option
- The environment variable DEBUGGER_PORT must be defined
@vados-cosmonic
Copy link
Contributor

Hey @andreiltd thanks for submitting this -- I'm going to leave the review to @tschneidereit since he knows the C++ side better (and the change looks fine to me!) but I wanted to ask if there should be some documentation changes that should go along with this?

Right now everything is kind of jammed into README.md but whether there or in a docs/debugging.md or something file, it might be nice to save the context you've put into the description, along with the fact that we can now debug in both instances?

@andreiltd
Copy link
Member Author

andreiltd commented Jul 3, 2025

Hey! Good point. I think we need to choose where the debugger documentation should live and link to it from other projects. I would prefer to have a chapter in StarlingMonkey mdbook if we decide to move forward with it: https://andreiltd.github.io/StarlingMonkey/

Copy link
Member

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Agreed with Victor on documentation, but given that we don't really have documentation for JS debugging at all right now, I don't want to block landing this on documentation. So I'll land it now, and we should talk about docs in more detail separately.

@tschneidereit tschneidereit merged commit 83b7763 into bytecodealliance:main Jul 3, 2025
16 checks passed
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.

3 participants