@@ -11,10 +11,10 @@ will be displayed indicating successful launch of the debugger:
1111
1212``` txt
1313$ node debug myscript.js
14- < debugger listening on port 5858
15- connecting... ok
14+ < Debugger listening on [::]: 5858
15+ connecting to 127.0.0.1:5858 ... ok
1616break in /home/indutny/Code/git/indutny/myscript.js:1
17- 1 x = 5;
17+ > 1 global. x = 5;
1818 2 setTimeout(() => {
1919 3 debugger;
2020debug>
@@ -28,37 +28,37 @@ enable a breakpoint at that position in the code:
2828
2929``` js
3030// myscript.js
31- x = 5 ;
31+ global . x = 5 ;
3232setTimeout (() => {
3333 debugger ;
3434 console .log (' world' );
3535}, 1000 );
3636console .log (' hello' );
3737```
3838
39- Once the debugger is run, a breakpoint will occur at line 4 :
39+ Once the debugger is run, a breakpoint will occur at line 3 :
4040
4141``` txt
4242$ node debug myscript.js
43- < debugger listening on port 5858
44- connecting... ok
43+ < Debugger listening on [::]: 5858
44+ connecting to 127.0.0.1:5858 ... ok
4545break in /home/indutny/Code/git/indutny/myscript.js:1
46- 1 x = 5;
46+ > 1 global. x = 5;
4747 2 setTimeout(() => {
4848 3 debugger;
4949debug> cont
5050< hello
5151break in /home/indutny/Code/git/indutny/myscript.js:3
52- 1 x = 5;
52+ 1 global. x = 5;
5353 2 setTimeout(() => {
54- 3 debugger;
54+ > 3 debugger;
5555 4 console.log('world');
5656 5 }, 1000);
5757debug> next
5858break in /home/indutny/Code/git/indutny/myscript.js:4
5959 2 setTimeout(() => {
6060 3 debugger;
61- 4 console.log('world');
61+ > 4 console.log('world');
6262 5 }, 1000);
6363 6 console.log('hello');
6464debug> repl
@@ -68,11 +68,11 @@ Press Ctrl + C to leave debug repl
6868> 2+2
69694
7070debug> next
71- < world
7271break in /home/indutny/Code/git/indutny/myscript.js:5
72+ < world
7373 3 debugger;
7474 4 console.log('world');
75- 5 }, 1000);
75+ > 5 }, 1000);
7676 6 console.log('hello');
7777 7
7878debug> quit
@@ -121,24 +121,26 @@ is not loaded yet:
121121
122122``` txt
123123$ node debug test/fixtures/break-in-module/main.js
124- < debugger listening on port 5858
125- connecting to port 5858... ok
124+ < Debugger listening on [::]: 5858
125+ connecting to 127.0.0.1: 5858 ... ok
126126break in test/fixtures/break-in-module/main.js:1
127- 1 var mod = require('./mod.js');
127+ > 1 var mod = require('./mod.js');
128128 2 mod.hello();
129129 3 mod.hello();
130- debug> setBreakpoint('mod.js', 23 )
130+ debug> setBreakpoint('mod.js', 2 )
131131Warning: script 'mod.js' was not loaded yet.
132- 1 var mod = require('./mod.js');
132+ > 1 var mod = require('./mod.js');
133133 2 mod.hello();
134134 3 mod.hello();
135+ 4 debugger;
136+ 5
137+ 6 });
135138debug> c
136- break in test/fixtures/break-in-module/mod.js:23
137- 21
138- 22 exports.hello = () => {
139- 23 return 'hello from module';
140- 24 };
141- 25
139+ break in test/fixtures/break-in-module/mod.js:2
140+ 1 exports.hello = function() {
141+ > 2 return 'hello from module';
142+ 3 };
143+ 4
142144debug>
143145```
144146
@@ -198,7 +200,11 @@ $ node --inspect index.js
198200Debugger listening on port 9229.
199201Warning: This is an experimental feature and could change at any time.
200202To start debugging, open the following URL in Chrome:
201- chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost :9229/node
203+ chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1 :9229/3a6d0a9e-0707-48f8-a7c6-48f157b67ab5
202204```
203205
206+ (In the example above, the UUID 3a6d0a9e-0707-48f8-a7c6-48f157b67ab5
207+ at the end of the URL is generated on the fly, it varies in different
208+ debugging sessions.)
209+
204210[ TCP-based protocol ] : https://github.com/v8/v8/wiki/Debugging-Protocol
0 commit comments