summaryrefslogtreecommitdiff
path: root/src/node_options.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-03-12 04:28:51 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-03-19 05:45:40 +0800
commit97a919b12dd214b4c1e938ed2cd0d25a3b2cdeab (patch)
tree2602d8ceb906dd54d1f904fc5df81dabc1c44453 /src/node_options.h
parenta91d36fcc12c90f842d38f4a6b50809133bf1bc7 (diff)
downloadandroid-node-v8-97a919b12dd214b4c1e938ed2cd0d25a3b2cdeab.tar.gz
android-node-v8-97a919b12dd214b4c1e938ed2cd0d25a3b2cdeab.tar.bz2
android-node-v8-97a919b12dd214b4c1e938ed2cd0d25a3b2cdeab.zip
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 <anna@addaleax.net> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_options.h')
-rw-r--r--src/node_options.h6
1 files changed, 6 insertions, 0 deletions
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;
}