Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2020-03-13 04:32:07 +0300
committercjihrig <cjihrig@gmail.com>2020-03-15 20:29:33 +0300
commita6bd2c2f81a0a238bf0f45174fee70b7870f8ef2 (patch)
tree8a2b6c784b75ec27ed6ce697a37d0707e6a92d1d
parent8617508d6b44a31abd904173cba6ca934bc094d2 (diff)
src: unconditionally include report feature
This commit removes all #ifdef NODE_REPORT checks in the src directory. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/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>
-rw-r--r--src/node.cc7
-rw-r--r--src/node_binding.cc8
-rw-r--r--src/node_errors.cc6
-rw-r--r--src/node_options.cc8
-rw-r--r--src/node_options.h8
5 files changed, 5 insertions, 32 deletions
diff --git a/src/node.cc b/src/node.cc
index 1fec85aa793..290d36d2d20 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -35,6 +35,7 @@
#include "node_options-inl.h"
#include "node_perf.h"
#include "node_process.h"
+#include "node_report.h"
#include "node_revert.h"
#include "node_v8_platform-inl.h"
#include "node_version.h"
@@ -67,10 +68,6 @@
#include "large_pages/node_large_page.h"
-#ifdef NODE_REPORT
-#include "node_report.h"
-#endif
-
#if defined(__APPLE__) || defined(__linux__)
#define NODE_USE_V8_WASM_TRAP_HANDLER 1
#else
@@ -781,11 +778,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
// Make inherited handles noninheritable.
uv_disable_stdio_inheritance();
-#ifdef NODE_REPORT
// Cache the original command line to be
// used in diagnostic reports.
per_process::cli_options->cmdline = *argv;
-#endif // NODE_REPORT
#if defined(NODE_V8_OPTIONS)
// Should come before the call to V8::SetFlagsFromCommandLine()
diff --git a/src/node_binding.cc b/src/node_binding.cc
index 37c64000650..592d0ca2a39 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -17,12 +17,6 @@
#define NODE_BUILTIN_ICU_MODULES(V)
#endif
-#if NODE_REPORT
-#define NODE_BUILTIN_REPORT_MODULES(V) V(report)
-#else
-#define NODE_BUILTIN_REPORT_MODULES(V)
-#endif
-
#if HAVE_INSPECTOR
#define NODE_BUILTIN_PROFILER_MODULES(V) V(profiler)
#else
@@ -67,6 +61,7 @@
V(pipe_wrap) \
V(process_wrap) \
V(process_methods) \
+ V(report) \
V(serdes) \
V(signal_wrap) \
V(spawn_sync) \
@@ -94,7 +89,6 @@
NODE_BUILTIN_STANDARD_MODULES(V) \
NODE_BUILTIN_OPENSSL_MODULES(V) \
NODE_BUILTIN_ICU_MODULES(V) \
- NODE_BUILTIN_REPORT_MODULES(V) \
NODE_BUILTIN_PROFILER_MODULES(V) \
NODE_BUILTIN_DTRACE_MODULES(V)
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 9d038e3d168..ae1da87ef6b 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -4,9 +4,7 @@
#include "debug_utils-inl.h"
#include "node_errors.h"
#include "node_internals.h"
-#ifdef NODE_REPORT
#include "node_report.h"
-#endif
#include "node_process.h"
#include "node_v8_platform-inl.h"
#include "util-inl.h"
@@ -405,14 +403,14 @@ void OnFatalError(const char* location, const char* message) {
} else {
FPrintF(stderr, "FATAL ERROR: %s\n", message);
}
-#ifdef NODE_REPORT
+
Isolate* isolate = Isolate::GetCurrent();
Environment* env = Environment::GetCurrent(isolate);
if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) {
report::TriggerNodeReport(
isolate, env, message, "FatalError", "", Local<String>());
}
-#endif // NODE_REPORT
+
fflush(stderr);
ABORT();
}
diff --git a/src/node_options.cc b/src/node_options.cc
index 3bf1031f166..35dd274d6fe 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -76,7 +76,7 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) {
void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
per_env->CheckOptions(errors);
-#ifdef NODE_REPORT
+
if (per_env->experimental_report) {
// Assign the report_signal default value here. Once the
// --experimental-report flag is dropped, move this initialization to
@@ -117,7 +117,6 @@ void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
"--report-uncaught-exception option is valid only when "
"--experimental-report is set");
}
-#endif // NODE_REPORT
}
void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
@@ -361,12 +360,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::experimental_vm_modules,
kAllowedInEnvironment);
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
-#ifdef NODE_REPORT
AddOption("--experimental-report",
"enable report generation",
&EnvironmentOptions::experimental_report,
kAllowedInEnvironment);
-#endif // NODE_REPORT
AddOption("--experimental-wasi-unstable-preview1",
"experimental WASI support",
&EnvironmentOptions::experimental_wasi,
@@ -620,8 +617,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"disable runtime allocation of executable memory",
V8Option{},
kAllowedInEnvironment);
-
-#ifdef NODE_REPORT
AddOption("--report-uncaught-exception",
"generate diagnostic report on uncaught exceptions",
&PerIsolateOptions::report_uncaught_exception,
@@ -650,7 +645,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
" (default: current working directory of Node.js process)",
&PerIsolateOptions::report_directory,
kAllowedInEnvironment);
-#endif // NODE_REPORT
Insert(eop, &PerIsolateOptions::get_per_env_options);
}
diff --git a/src/node_options.h b/src/node_options.h
index 470007f06b6..958eaf29571 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -151,9 +151,7 @@ class EnvironmentOptions : public Options {
bool syntax_check_only = false;
bool has_eval_string = false;
-#ifdef NODE_REPORT
bool experimental_report = false;
-#endif // NODE_REPORT
bool experimental_wasi = false;
std::string eval_string;
bool print_eval = false;
@@ -187,15 +185,12 @@ class PerIsolateOptions : public Options {
std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() };
bool track_heap_objects = false;
bool no_node_snapshot = false;
-
-#ifdef NODE_REPORT
bool report_uncaught_exception = false;
bool report_on_signal = false;
bool report_on_fatalerror = false;
std::string report_signal;
std::string report_filename;
std::string report_directory;
-#endif // NODE_REPORT
inline EnvironmentOptions* get_per_env_options();
void CheckOptions(std::vector<std::string>* errors) override;
};
@@ -239,10 +234,7 @@ class PerProcessOptions : public Options {
#endif
std::string use_largepages = "off";
bool trace_sigint = false;
-
-#ifdef NODE_REPORT
std::vector<std::string> cmdline;
-#endif // NODE_REPORT
inline PerIsolateOptions* get_per_isolate_options();
void CheckOptions(std::vector<std::string>* errors) override;