Don't always enable debug on startup
Improves startup time. Problem introduced in 4ab5476e89266194d82215214a1a870c9b79e295
This commit is contained in:
parent
497fe79f97
commit
bca6e35b2b
16
src/node.cc
16
src/node.cc
@ -2343,13 +2343,6 @@ static void EnableDebug(bool wait_connect) {
|
||||
static volatile bool hit_signal;
|
||||
|
||||
|
||||
static void EnableDebugSignalHandler(int signal) {
|
||||
// This is signal safe.
|
||||
hit_signal = true;
|
||||
v8::Debug::DebugBreak();
|
||||
}
|
||||
|
||||
|
||||
static void DebugSignalCB(const Debug::EventDetails& details) {
|
||||
if (hit_signal && details.GetEvent() == v8::Break) {
|
||||
hit_signal = false;
|
||||
@ -2359,6 +2352,14 @@ static void DebugSignalCB(const Debug::EventDetails& details) {
|
||||
}
|
||||
|
||||
|
||||
static void EnableDebugSignalHandler(int signal) {
|
||||
// This is signal safe.
|
||||
hit_signal = true;
|
||||
v8::Debug::SetDebugEventListener2(DebugSignalCB);
|
||||
v8::Debug::DebugBreak();
|
||||
}
|
||||
|
||||
|
||||
#ifdef __POSIX__
|
||||
|
||||
static int RegisterSignalHandler(int signal, void (*handler)(int)) {
|
||||
@ -2480,7 +2481,6 @@ char** Init(int argc, char *argv[]) {
|
||||
} else {
|
||||
#ifdef __POSIX__
|
||||
RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
|
||||
Debug::SetDebugEventListener2(DebugSignalCB);
|
||||
#endif // __POSIX__
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user