src: implement runtime option --no-node-snapshot for debugging · nodejs/node@4f035e4 · GitHub
Skip to content

Commit 4f035e4

Browse files
joyeecheungtargos
authored andcommitted
src: implement runtime option --no-node-snapshot for debugging
PR-URL: #28567 Refs: #28558 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 0e2cbe6 commit 4f035e4

5 files changed

Lines changed: 27 additions & 10 deletions

File tree

src/node.cc

Lines changed: 15 additions & 10 deletions

src/node_options.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
527527
"track heap object allocations for heap snapshots",
528528
&PerIsolateOptions::track_heap_objects,
529529
kAllowedInEnvironment);
530+
AddOption("--no-node-snapshot",
531+
"", // It's a debug-only option.
532+
&PerIsolateOptions::no_node_snapshot,
533+
kAllowedInEnvironment);
530534

531535
// Explicitly add some V8 flags to mark them as allowed in NODE_OPTIONS.
532536
AddOption("--abort-on-uncaught-exception",

src/node_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class PerIsolateOptions : public Options {
172172
public:
173173
std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() };
174174
bool track_heap_objects = false;
175+
bool no_node_snapshot = false;
175176

176177
#ifdef NODE_REPORT
177178
bool report_uncaught_exception = false;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
// Flags: --no-node-snapshot
4+
5+
require('../common');

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)