diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-10-21 13:52:04 +0200 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2016-06-02 22:40:45 +1000 |
commit | 2184e772d272dba5621014bda9f00d4c974430ce (patch) | |
tree | 6d9aaf3d37e8039159524f5ea19e5b14699485ed /lib | |
parent | bf3afce6686c50230c0f299346783a86ef655ab7 (diff) | |
download | node-new-2184e772d272dba5621014bda9f00d4c974430ce.tar.gz |
debugger: propagate --debug-port= to debuggee
Before this commit `node --debug-port=1234 debug t.js` ignored the
--debug-port= argument, binding to the default port 5858 instead,
making it impossible to debug more than one process on the same
machine that way.
This commit also reduces the number of places where the default port
is hard-coded by one.
Fixes: https://github.com/nodejs/node/issues/3345
PR-URL: https://github.com/nodejs/node/pull/3470
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_debugger.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js index e872d77ea5..7da2f70bca 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -26,7 +26,7 @@ exports.start = function(argv, stdin, stdout) { stdin = stdin || process.stdin; stdout = stdout || process.stdout; - const args = ['--debug-brk'].concat(argv); + const args = [`--debug-brk=${exports.port}`].concat(argv); const interface_ = new Interface(stdin, stdout, args); stdin.resume(); @@ -41,7 +41,7 @@ exports.start = function(argv, stdin, stdout) { }); }; -exports.port = 5858; +exports.port = process.debugPort; // |