Skip to content

Commit

Permalink
inspector: restore --debug-brk alias
Browse files Browse the repository at this point in the history
--inspect-brk didn't exist prior to 7.6.0, and --debug-brk doesn't exist
after nodejs#12197, leaving no consistent
way to start node with inspector activated and breaking on first line.
Add --debug-brk back in as an undocumented option until 7.x is no longer
supported.

Fixes: nodejs#12364
  • Loading branch information
sam-github committed Apr 22, 2017
1 parent bde26a6 commit 85bf8d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/node_debug_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ bool DebugOptions::ParseOption(const std::string& option) {
argument = option.substr(pos + 1);
}

// Note that --debug-port and --debug-brk are undocumented, but to be
// supported until 7.x is no longer supported, not even in LTS (see #12364).
if (option_name == "--inspect") {
debugger_enabled_ = true;
enable_inspector = true;
} else if (option_name == "--inspect-brk") {
} else if (option_name == "--inspect-brk" || option_name == "--debug-brk") {
debugger_enabled_ = true;
enable_inspector = true;
wait_connect_ = true;
} else if ((option_name != "--debug-port" &&
option_name != "--inspect-port") ||
!has_argument) {
// only other valid possibility is --inspect-port,
// which requires an argument
} else if (option_name == "--inspect-port" || option_name == "--debug-port") {
if (!has_argument) return false;
} else {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/node_debug_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DebugOptions {
#if HAVE_INSPECTOR
bool inspector_enabled_;
#endif // HAVE_INSPECTOR
bool wait_connect_;
bool wait_connect_; // --inspect-brk
bool http_enabled_;
std::string host_name_;
int port_;
Expand Down

0 comments on commit 85bf8d0

Please sign in to comment.