Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index b33decae64f3fe6e027fcf3f63cdec20924574a1..a71dcfaec31a7725760646d1263013c3811f8d4d 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -35,6 +35,7 @@ |
#include "src/debug/debug.h" |
#include "src/deoptimizer.h" |
#include "src/execution.h" |
+#include "src/gdb-jit.h" |
#include "src/global-handles.h" |
#include "src/icu_util.h" |
#include "src/isolate-inl.h" |
@@ -7160,10 +7161,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) { |
if (params.entry_hook) { |
isolate->set_function_entry_hook(params.entry_hook); |
} |
- if (params.code_event_handler) { |
+ auto code_event_handler = params.code_event_handler; |
+#ifdef ENABLE_GDB_JIT_INTERFACE |
+ if (code_event_handler == nullptr && i::FLAG_gdbjit) { |
+ code_event_handler = i::GDBJITInterface::EventHandler; |
+ } |
+#endif // ENABLE_GDB_JIT_INTERFACE |
+ if (code_event_handler) { |
isolate->InitializeLoggingAndCounters(); |
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, |
- params.code_event_handler); |
+ code_event_handler); |
} |
if (params.counter_lookup_callback) { |
v8_isolate->SetCounterFunction(params.counter_lookup_callback); |