mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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>
This commit is contained in:
1 parent
c00ce7b708
commit
1950c08ab1
5 files changed
+5
-32
No files matched your search
+1
-6
@@ -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()
|
||||
|
||||
+1
-7
@@ -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)
|
||||
|
||||
|
||||
+2
-4
@@ -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();
|
||||
}
|
||||
|
||||
+1
-7
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user