-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: introduce inspect-brk-node #20819
Conversation
Is there another way to accomplish this? I don't really like the idea of adding a new option (certainly not a documented option) for functionality that is probably only relevant to core developers. |
I'm not sure and part of the reason for opening this pr. Hopefully someone more familiar can chime in if there are other ways to achieve this. |
Your original approach (setting a breakpoint) should still work. We need to look into why it does not. Another option is to add a "debugger" statement into the bootstrap code. |
Would you be able to try this out just to make sure this is not something local to my environment?
That works for sure, the only downside is that it requires a recompilation when added to any of the core javascript sources. |
Adding the @nodejs/tsc review label to get some more opinions. |
src/node.cc
Outdated
@@ -3517,6 +3523,8 @@ static void PrintHelp() { | |||
" --inspect-brk[=[host:]port]\n" | |||
" activate inspector on host:port\n" | |||
" and break at start of user script\n" | |||
" --inspect-brk-node will break in node's bootstrap code\n" | |||
" (default: false)\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only relevant to Node core developers, I do not think we should really document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can document this somewhere in doc/guide
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this seems to fall along the same lines as --expose-internals
... we don't document that one for similar reasons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove the info from PrintHelp and take a look at adding this to doc/guide
. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not really been able to find a good place for this in any of the docs in doc/guide
. @joyeecheung Do you have any suggestions where this might go?
Would it be alright if it is not documented as that seems to be the case for --expose-internals
?
node-test-commit-freebsd failure looks unrelatedHTTP ERROR 404
Problem accessing /job/node-test-commit-freebsd/nodes=freebsd11-x64/17862/. Reason:
Not Found |
This commit is a suggestion to add a new option to the node executable to allow for breaking in node's javascript bootstrapper code. Previously I've been able to set breakpoints in node bootstrapper code and then restart the debugging session and those breakpoints would be hit, but I don't seem to be able to do so anymore. Having this option would allow me to use this option and then step through or add more break points as needed. $ ./node --help Usage: node [options] [ -e script | script.js | - ] [arguments] node inspect script.js [arguments] Options: ... --inspect-brk-node will break in node's bootstrap code (default: false) ... Currently test are missing as I wanted to see if this is worth pursuing first.
Landed in 9ca41e9. |
This commit is a suggestion to add a new option to the node executable to allow for breaking in node's javascript bootstrapper code. Previously I've been able to set breakpoints in node bootstrapper code and then restart the debugging session and those breakpoints would be hit, but I don't seem to be able to do so anymore. Having this option would allow me to use this option and then step through or add more break points as needed. PR-URL: #20819 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit is a suggestion to add a new option to the node executable to allow for breaking in node's javascript bootstrapper code. Previously I've been able to set breakpoints in node bootstrapper code and then restart the debugging session and those breakpoints would be hit, but I don't seem to be able to do so anymore. Having this option would allow me to use this option and then step through or add more break points as needed. PR-URL: #20819 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit is a suggestion to add a new option to the node executable
to allow for breaking in node's javascript bootstrapper code.
Previously I've been able to set breakpoints in node bootstrapper code
and then restart the debugging session and those breakpoints would be
hit, but I don't seem to be able to do so anymore. Having this option
would allow me to use this option and then step through or add more
break points as needed.
Currently test are missing as I wanted to see if this is worth
pursuing first.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes