Skip to content

Commit

Permalink
src: remove support for --debug
Browse files Browse the repository at this point in the history
In the 2017-04-05 meeting, the CTC agreed to remove support for the
legacy debugger in 8.0.0. This is the first step in this direction.

Refs: nodejs/CTC#94
PR-URL: nodejs/node#12197
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Jan Krems authored and targos committed Apr 6, 2017
1 parent e139dae commit 47f8f74
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 608 deletions.
19 changes: 0 additions & 19 deletions doc/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,27 +169,8 @@ breakpoint)

## Advanced Usage

### TCP-based protocol

> Stability: 0 - Deprecated: Use [V8 Inspector Integration][] instead.
The debug protocol used by the `--debug` flag was removed from V8.

An alternative way of enabling and accessing the debugger is to start
Node.js with the `--debug` command-line flag or by signaling an existing
Node.js process with `SIGUSR1`.

Once a process has been set in debug mode this way, it can be inspected
using the Node.js debugger by either connecting to the `pid` of the running
process or via URI reference to the listening debugger:

* `node debug -p <pid>` - Connects to the process via the `pid`
* `node debug <URI>` - Connects to the process via the URI such as
localhost:5858

### V8 Inspector Integration for Node.js

**NOTE: This is an experimental feature.**

V8 Inspector integration allows attaching Chrome DevTools to Node.js
instances for debugging and profiling. It uses the [Chrome Debugging Protocol][].

Expand Down
5 changes: 2 additions & 3 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1757,9 +1757,8 @@ cases:
source code internal in Node.js's bootstrapping process threw an error
when the bootstrapping function was called. This is extremely rare,
and generally can only happen during development of Node.js itself.
* `12` **Invalid Debug Argument** - The `--debug`, `--inspect` and/or
`--debug-brk` options were set, but the port number chosen was invalid
or unavailable.
* `12` **Invalid Debug Argument** - The `--inspect` and/or `--inspect-brk`
options were set, but the port number chosen was invalid or unavailable.
* `>128` **Signal Exits** - If Node.js receives a fatal signal such as
`SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the
value of the signal code. This is a standard Unix practice, since
Expand Down
10 changes: 2 additions & 8 deletions src/node_debug_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ bool DebugOptions::ParseOption(const std::string& option) {
argument = option.substr(pos + 1);
}

// --debug and --inspect are mutually exclusive
if (option_name == "--debug") {
debugger_enabled_ = true;
} else if (option_name == "--debug-brk") {
debugger_enabled_ = true;
wait_connect_ = true;
} else if (option_name == "--inspect") {
if (option_name == "--inspect") {
debugger_enabled_ = true;
enable_inspector = true;
} else if (option_name == "--inspect-brk") {
Expand All @@ -108,7 +102,7 @@ bool DebugOptions::ParseOption(const std::string& option) {
} else if ((option_name != "--debug-port" &&
option_name != "--inspect-port") ||
!has_argument) {
// only other valid possibility is --debug-port,
// only other valid possibility is --inspect-port,
// which requires an argument
return false;
}
Expand Down
42 changes: 0 additions & 42 deletions test/parallel/test-cluster-debug-port.js

This file was deleted.

8 changes: 3 additions & 5 deletions test/parallel/test-cluster-inspector-debug-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ if (cluster.isMaster) {
fork(1);
fork(2, ['--inspect']);
fork(3, [`--inspect=${debuggerPort}`]);
fork(4, ['--inspect', '--debug']);
fork(5, [`--debug=${debuggerPort}`, '--inspect']);
fork(6, ['--inspect', `--debug-port=${debuggerPort}`]);
fork(7, [`--inspect-port=${debuggerPort}`]);
fork(8, ['--inspect', `--inspect-port=${debuggerPort}`]);
fork(4, ['--inspect', `--debug-port=${debuggerPort}`]);
fork(5, [`--inspect-port=${debuggerPort}`]);
fork(6, ['--inspect', `--inspect-port=${debuggerPort}`]);
} else {
const hasDebugArg = process.execArgv.some(function(arg) {
return /inspect/.test(arg);
Expand Down
13 changes: 0 additions & 13 deletions test/parallel/test-debug-brk-no-arg.js

This file was deleted.

70 changes: 0 additions & 70 deletions test/parallel/test-debug-brk.js

This file was deleted.

26 changes: 0 additions & 26 deletions test/parallel/test-debug-no-context.js

This file was deleted.

52 changes: 0 additions & 52 deletions test/parallel/test-debug-port-cluster.js

This file was deleted.

63 changes: 0 additions & 63 deletions test/parallel/test-debug-port-from-cmdline.js

This file was deleted.

Loading

0 comments on commit 47f8f74

Please sign in to comment.