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
inspector: introduce the --inspect-wait
flag
#52734
inspector: introduce the --inspect-wait
flag
#52734
Conversation
23e582e
to
6422bd5
Compare
I'm not sure I understand the use case? Shouldn't this be solved from the consumer side that can call |
Yes, the |
cc @nodejs/inspector |
Please update https://github.com/nodejs/node/blob/main/doc/node.1 also. |
6422bd5
to
9075189
Compare
@daeyeon Done |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
--> | ||
|
||
Activate inspector on `host:port` and wait for debugger to be attached. | ||
Default `host:port` is `127.0.0.1:9229`. |
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.
The docs should likely include additional detail explaining the difference between this and --inspect-brk
. Just looking at this I would have no idea as an unfamiliar user which to choose and why.
doc/api/debugger.md
Outdated
Using the `--inspect` flag will execute the code immediately before debugger | ||
is connected. This could be problematic if you intend to debug the code from the beginning. | ||
In such cases, you can use the `--inspect-wait` flag instead, which waits for debugger to be attached, | ||
or the `--inspect-brk` flag to break on the first line of the code. |
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.
This is good but could be expanded a bit to explain more of the difference. Why would I use one verses the other?
0b0ac58
to
ba10f45
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ba10f45
to
c2bd69d
Compare
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.
It would be good to get other folks reviewing the documentation if possible. As for the code, this LGTM.
Landed in c0ae3b2 |
This PR introduces the
--inspect-wait
flag, which allows debugger to wait for attachement. This flag is useful when you want to debug the code from the beginning. Unlike--inspect-brk
, which breaks on the first line, this flag waits for debugger to be connected and then runs the code as soon as a session is established.It's designed to simplify debugging by removing the need for manual intervention and providing a smoother debugging experience. With support for breaking on the first line and automatic process resumption, it streamlines the debugging process.
Other runtime works include: