Skip to content

Commit 1950c08

Browse files
cjihrigMylesBorins
authored andcommitted
src: unconditionally include report feature
This commit removes all #ifdef NODE_REPORT checks in the src directory. PR-URL: #32242 Fixes: #26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent c00ce7b commit 1950c08

File tree

5 files changed

+5
-32
lines changed

5 files changed

+5
-32
lines changed

src/node.cc

+1-6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "node_options-inl.h"
3636
#include "node_perf.h"
3737
#include "node_process.h"
38+
#include "node_report.h"
3839
#include "node_revert.h"
3940
#include "node_v8_platform-inl.h"
4041
#include "node_version.h"
@@ -67,10 +68,6 @@
6768

6869
#include "large_pages/node_large_page.h"
6970

70-
#ifdef NODE_REPORT
71-
#include "node_report.h"
72-
#endif
73-
7471
#if defined(__APPLE__) || defined(__linux__)
7572
#define NODE_USE_V8_WASM_TRAP_HANDLER 1
7673
#else
@@ -781,11 +778,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
781778
// Make inherited handles noninheritable.
782779
uv_disable_stdio_inheritance();
783780

784-
#ifdef NODE_REPORT
785781
// Cache the original command line to be
786782
// used in diagnostic reports.
787783
per_process::cli_options->cmdline = *argv;
788-
#endif // NODE_REPORT
789784

790785
#if defined(NODE_V8_OPTIONS)
791786
// Should come before the call to V8::SetFlagsFromCommandLine()

src/node_binding.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
#define NODE_BUILTIN_ICU_MODULES(V)
1818
#endif
1919

20-
#if NODE_REPORT
21-
#define NODE_BUILTIN_REPORT_MODULES(V) V(report)
22-
#else
23-
#define NODE_BUILTIN_REPORT_MODULES(V)
24-
#endif
25-
2620
#if HAVE_INSPECTOR
2721
#define NODE_BUILTIN_PROFILER_MODULES(V) V(profiler)
2822
#else
@@ -67,6 +61,7 @@
6761
V(pipe_wrap) \
6862
V(process_wrap) \
6963
V(process_methods) \
64+
V(report) \
7065
V(serdes) \
7166
V(signal_wrap) \
7267
V(spawn_sync) \
@@ -94,7 +89,6 @@
9489
NODE_BUILTIN_STANDARD_MODULES(V) \
9590
NODE_BUILTIN_OPENSSL_MODULES(V) \
9691
NODE_BUILTIN_ICU_MODULES(V) \
97-
NODE_BUILTIN_REPORT_MODULES(V) \
9892
NODE_BUILTIN_PROFILER_MODULES(V) \
9993
NODE_BUILTIN_DTRACE_MODULES(V)
10094

src/node_errors.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#include "debug_utils-inl.h"
55
#include "node_errors.h"
66
#include "node_internals.h"
7-
#ifdef NODE_REPORT
87
#include "node_report.h"
9-
#endif
108
#include "node_process.h"
119
#include "node_v8_platform-inl.h"
1210
#include "util-inl.h"
@@ -405,14 +403,14 @@ void OnFatalError(const char* location, const char* message) {
405403
} else {
406404
FPrintF(stderr, "FATAL ERROR: %s\n", message);
407405
}
408-
#ifdef NODE_REPORT
406+
409407
Isolate* isolate = Isolate::GetCurrent();
410408
Environment* env = Environment::GetCurrent(isolate);
411409
if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) {
412410
report::TriggerNodeReport(
413411
isolate, env, message, "FatalError", "", Local<String>());
414412
}
415-
#endif // NODE_REPORT
413+
416414
fflush(stderr);
417415
ABORT();
418416
}

src/node_options.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) {
7676

7777
void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
7878
per_env->CheckOptions(errors);
79-
#ifdef NODE_REPORT
79+
8080
if (per_env->experimental_report) {
8181
// Assign the report_signal default value here. Once the
8282
// --experimental-report flag is dropped, move this initialization to
@@ -117,7 +117,6 @@ void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
117117
"--report-uncaught-exception option is valid only when "
118118
"--experimental-report is set");
119119
}
120-
#endif // NODE_REPORT
121120
}
122121

123122
void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
@@ -361,12 +360,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
361360
&EnvironmentOptions::experimental_vm_modules,
362361
kAllowedInEnvironment);
363362
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
364-
#ifdef NODE_REPORT
365363
AddOption("--experimental-report",
366364
"enable report generation",
367365
&EnvironmentOptions::experimental_report,
368366
kAllowedInEnvironment);
369-
#endif // NODE_REPORT
370367
AddOption("--experimental-wasi-unstable-preview1",
371368
"experimental WASI support",
372369
&EnvironmentOptions::experimental_wasi,
@@ -620,8 +617,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
620617
"disable runtime allocation of executable memory",
621618
V8Option{},
622619
kAllowedInEnvironment);
623-
624-
#ifdef NODE_REPORT
625620
AddOption("--report-uncaught-exception",
626621
"generate diagnostic report on uncaught exceptions",
627622
&PerIsolateOptions::report_uncaught_exception,
@@ -650,7 +645,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
650645
" (default: current working directory of Node.js process)",
651646
&PerIsolateOptions::report_directory,
652647
kAllowedInEnvironment);
653-
#endif // NODE_REPORT
654648

655649
Insert(eop, &PerIsolateOptions::get_per_env_options);
656650
}

src/node_options.h

-8
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ class EnvironmentOptions : public Options {
151151

152152
bool syntax_check_only = false;
153153
bool has_eval_string = false;
154-
#ifdef NODE_REPORT
155154
bool experimental_report = false;
156-
#endif // NODE_REPORT
157155
bool experimental_wasi = false;
158156
std::string eval_string;
159157
bool print_eval = false;
@@ -187,15 +185,12 @@ class PerIsolateOptions : public Options {
187185
std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() };
188186
bool track_heap_objects = false;
189187
bool no_node_snapshot = false;
190-
191-
#ifdef NODE_REPORT
192188
bool report_uncaught_exception = false;
193189
bool report_on_signal = false;
194190
bool report_on_fatalerror = false;
195191
std::string report_signal;
196192
std::string report_filename;
197193
std::string report_directory;
198-
#endif // NODE_REPORT
199194
inline EnvironmentOptions* get_per_env_options();
200195
void CheckOptions(std::vector<std::string>* errors) override;
201196
};
@@ -239,10 +234,7 @@ class PerProcessOptions : public Options {
239234
#endif
240235
std::string use_largepages = "off";
241236
bool trace_sigint = false;
242-
243-
#ifdef NODE_REPORT
244237
std::vector<std::string> cmdline;
245-
#endif // NODE_REPORT
246238

247239
inline PerIsolateOptions* get_per_isolate_options();
248240
void CheckOptions(std::vector<std::string>* errors) override;

0 commit comments

Comments
 (0)