-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: update output examples in debugger.md #10944
Conversation
/cc @nodejs/documentation |
@jasnell Could this be landed? |
I'd like a bit more sign off. @nodejs/documentation |
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.
Two fixes recommended in comments:
var x = 5
rather thanglobal.x = 5
- Don't use a specific UUID in the chrome-devtools URL.
Thanks for the contribution!
@@ -203,7 +205,7 @@ $ node --inspect index.js | |||
Debugger listening on port 9229. | |||
Warning: This is an experimental feature and could change at any time. | |||
To start debugging, open the following URL in Chrome: | |||
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node | |||
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/dc9010dd-f8b8-4ac5-a510-c1a114ec7d29 |
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.
Unfotunately the UUID changes with each Node instance, so we shouldn't use a specific one here. Perhaps a placeholder like <uuid>
would be sufficient?
@@ -28,7 +28,7 @@ enable a breakpoint at that position in the code: | |||
|
|||
```js | |||
// myscript.js | |||
x = 5; | |||
global.x = 5; |
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.
var x = 5
and the same in the output examples would be more representative of usage IMO.
break in /home/indutny/Code/git/indutny/myscript.js:1 | ||
1 x = 5; | ||
> 1 global.x = 5; |
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.
var x = 5
break in /home/indutny/Code/git/indutny/myscript.js:1 | ||
1 x = 5; | ||
> 1 global.x = 5; |
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.
var x = 5
2 setTimeout(() => { | ||
3 debugger; | ||
debug> cont | ||
< hello | ||
break in /home/indutny/Code/git/indutny/myscript.js:3 | ||
1 x = 5; | ||
1 global.x = 5; |
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.
var x = 5
|
Ah I see, the example is stopping within a callback so that variable isn't there. I guess It would be great if you have a better idea than the "<uuid>" string 😄 , but there's not really another option at the moment I don't think? LGTM |
@joshgav Sorry, I have not) Does anybody have? |
Maybe use an example uuid string and then add a note/comment explaining that string is just an example, it would be generated on the fly? |
@joyeecheung Like this?
(The UUID in the end of the URL is generated on the fly, it will vary.) |
@vsemozhetbyt Probably
|
@joyeecheung Done. |
@jasnell @joshgav @joyeecheung Could we proceed? |
Still LGTM. @joyeecheung PTAL |
PR-URL: #10944 Reviewed-By: Josh Gavant <joshgavant@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
added a period to end of a sentence and landed in ca8c30a Thanks @vsemozhetbyt! |
This is not landing clearly in |
PR-URL: nodejs#10944 Reviewed-By: Josh Gavant <joshgavant@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the |
Checklist
Affected core subsystem(s)
doc, debugger
x = 5;
by explicitglobal.x = 5;
to stress the intent to create a global variable (needed for access from debug REPL).>
) in output according to real output.Some updates are done due to previous changes in
test/fixtures/break-in-module/main.js
andtest/fixtures/break-in-module/mod.js
files.