From 97a919b12dd214b4c1e938ed2cd0d25a3b2cdeab Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 12 Mar 2019 04:28:51 +0800 Subject: inspector: patch C++ debug options instead of process._breakFirstLine Instead of patching process._breakFirstLine to inform the JS land to wait for the debugger, check that the JS land has not yet serialized the options and then patch the debug options from C++. The changes will be carried into JS later during option serialization. PR-URL: https://github.com/nodejs/node/pull/26602 Reviewed-By: Anna Henningsen Reviewed-By: Eugene Ostroukhov Reviewed-By: Ruben Bridgewater --- src/node_options.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/node_options.h') diff --git a/src/node_options.h b/src/node_options.h index a49425388c..e8fb002094 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -75,6 +75,12 @@ class DebugOptions : public Options { HostPort host_port{"127.0.0.1", kDefaultInspectorPort}; + // Used to patch the options as if --inspect-brk is passed. + void EnableBreakFirstLine() { + inspector_enabled = true; + break_first_line = true; + } + bool wait_for_connect() const { return break_first_line || break_node_first_line; } -- cgit v1.2.3