Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Unable to use V8's --debug options due to Node option parsing #6526

Closed
metamatt opened this issue Nov 15, 2013 · 2 comments
Closed

Unable to use V8's --debug options due to Node option parsing #6526

metamatt opened this issue Nov 15, 2013 · 2 comments

Comments

@metamatt
Copy link

V8 has several debug options which would be enabled by passing various flags starting with --debug on the nodejs command line:

magi@ubuntu ~/s/d/experiments> node --v8-options | grep -- --debug
  --debug_code (generate extra code (assertions) for debugging)
  --debugger_auto_break (automatically set the debug break flag when debugger commands are in the queue)
  --debugger (Enable JavaScript debugger)
  --debugger_agent (Enable debugger agent)
  --debugger_port (Port to use for remote debugging)
  --debug_compile_events (Enable debugger compile events)
  --debug_script_collected_events (Enable debugger script collected events)

However, trying to use any of these results in

magi@ubuntu ~/s/d/experiments> node --debugger_auto_break
Bad debug option.
Usage: node [options] [ -e script | script.js ] [arguments]
       node debug script.js [arguments]
...

This is because any command-line option starting with the string --debug gets passed to ParseDebugOpt and ParseDebugOpt always exits the process if it doesn't find one of Node's own debug options.

I think this needs a passthrough to allow use of the V8 options.

@metamatt
Copy link
Author

Alternately, ParseDebugOpt handles only --debug, --debug=, --debug-brk, and --debug-brk=. We could pass only those to it, and let the others fall through to V8. Is the stricter Bad debug option behavior useful to anyone?

@bnoordhuis
Copy link
Member

Fixed in bd9c666, thanks for the report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants