Skip to content

Commit 2939a45

Browse files
cjihrigtargos
authored andcommitted
src: unconditionally include report feature
This commit removes all #ifdef NODE_REPORT checks in the src directory. PR-URL: nodejs#32242 Fixes: nodejs#26293 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 127e2ba commit 2939a45

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
// ========== global C headers ==========
7572

7673
#include <fcntl.h> // _O_RDWR
@@ -733,11 +730,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
733730
// Make inherited handles noninheritable.
734731
uv_disable_stdio_inheritance();
735732

736-
#ifdef NODE_REPORT
737733
// Cache the original command line to be
738734
// used in diagnostic reports.
739735
per_process::cli_options->cmdline = *argv;
740-
#endif // NODE_REPORT
741736

742737
#if defined(NODE_V8_OPTIONS)
743738
// 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
@@ -68,6 +62,7 @@
6862
V(pipe_wrap) \
6963
V(process_wrap) \
7064
V(process_methods) \
65+
V(report) \
7166
V(serdes) \
7267
V(signal_wrap) \
7368
V(spawn_sync) \
@@ -95,7 +90,6 @@
9590
NODE_BUILTIN_STANDARD_MODULES(V) \
9691
NODE_BUILTIN_OPENSSL_MODULES(V) \
9792
NODE_BUILTIN_ICU_MODULES(V) \
98-
NODE_BUILTIN_REPORT_MODULES(V) \
9993
NODE_BUILTIN_PROFILER_MODULES(V) \
10094
NODE_BUILTIN_DTRACE_MODULES(V)
10195

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) {
@@ -365,12 +364,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
365364
&EnvironmentOptions::experimental_vm_modules,
366365
kAllowedInEnvironment);
367366
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
368-
#ifdef NODE_REPORT
369367
AddOption("--experimental-report",
370368
"enable report generation",
371369
&EnvironmentOptions::experimental_report,
372370
kAllowedInEnvironment);
373-
#endif // NODE_REPORT
374371
AddOption("--experimental-wasi-unstable-preview1",
375372
"experimental WASI support",
376373
&EnvironmentOptions::experimental_wasi,
@@ -629,8 +626,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
629626
"disable runtime allocation of executable memory",
630627
V8Option{},
631628
kAllowedInEnvironment);
632-
633-
#ifdef NODE_REPORT
634629
AddOption("--report-uncaught-exception",
635630
"generate diagnostic report on uncaught exceptions",
636631
&PerIsolateOptions::report_uncaught_exception,
@@ -659,7 +654,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
659654
" (default: current working directory of Node.js process)",
660655
&PerIsolateOptions::report_directory,
661656
kAllowedInEnvironment);
662-
#endif // NODE_REPORT
663657

664658
Insert(eop, &PerIsolateOptions::get_per_env_options);
665659
}

src/node_options.h

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

153153
bool syntax_check_only = false;
154154
bool has_eval_string = false;
155-
#ifdef NODE_REPORT
156155
bool experimental_report = false;
157-
#endif // NODE_REPORT
158156
bool experimental_wasi = false;
159157
std::string eval_string;
160158
bool print_eval = false;
@@ -188,15 +186,12 @@ class PerIsolateOptions : public Options {
188186
std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() };
189187
bool track_heap_objects = false;
190188
bool no_node_snapshot = false;
191-
192-
#ifdef NODE_REPORT
193189
bool report_uncaught_exception = false;
194190
bool report_on_signal = false;
195191
bool report_on_fatalerror = false;
196192
std::string report_signal;
197193
std::string report_filename;
198194
std::string report_directory;
199-
#endif // NODE_REPORT
200195
inline EnvironmentOptions* get_per_env_options();
201196
void CheckOptions(std::vector<std::string>* errors) override;
202197
};
@@ -241,10 +236,7 @@ class PerProcessOptions : public Options {
241236
#endif
242237
std::string use_largepages = "off";
243238
bool trace_sigint = false;
244-
245-
#ifdef NODE_REPORT
246239
std::vector<std::string> cmdline;
247-
#endif // NODE_REPORT
248240

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

0 commit comments

Comments
 (0)