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 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) {
|
static void DebugSignalCB(const Debug::EventDetails& details) {
|
||||||
if (hit_signal && details.GetEvent() == v8::Break) {
|
if (hit_signal && details.GetEvent() == v8::Break) {
|
||||||
hit_signal = false;
|
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__
|
#ifdef __POSIX__
|
||||||
|
|
||||||
static int RegisterSignalHandler(int signal, void (*handler)(int)) {
|
static int RegisterSignalHandler(int signal, void (*handler)(int)) {
|
||||||
@ -2480,7 +2481,6 @@ char** Init(int argc, char *argv[]) {
|
|||||||
} else {
|
} else {
|
||||||
#ifdef __POSIX__
|
#ifdef __POSIX__
|
||||||
RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
|
RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
|
||||||
Debug::SetDebugEventListener2(DebugSignalCB);
|
|
||||||
#endif // __POSIX__
|
#endif // __POSIX__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user