diff --git a/binding.gyp b/binding.gyp index fb2a629..3c59de7 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,6 +1,6 @@ { "variables": { - "BUILD_WITH_LIBEXEC": "ExceptionRecord->ExceptionAddress; + code = (long)exceptionInfo->ExceptionRecord->ExceptionCode; + + switch (code) { + case DBG_PRINTEXCEPTION_WIDE_C: + case DBG_PRINTEXCEPTION_C: + // fprintf(stderr, "Debug exception %lx.\n", code); + return EXCEPTION_CONTINUE_SEARCH; + case kVCThreadNameException: + // fprintf(stderr, "Setting thread name %lx.\n", code); + return EXCEPTION_CONTINUE_SEARCH; + default: + break; + } #else address = (long)si->si_addr; + code = 0; #endif // Write the header line n = SNPRINTF( sbuff, BUFF_SIZE, - "PID %d received SIGSEGV for address: 0x%lx\n", + "PID %d received SIGSEGV for address: 0x%lx code: 0x%lx\n", pid, - address + address, + code ); + if (code == DBG_PRINTEXCEPTION_C || code == DBG_PRINTEXCEPTION_WIDE_C) { + + } + if(fd > 0) { if (WRITE(fd, sbuff, n) != n) { fprintf(stderr, "NodeSegfaultHandlerNative: Error writing to file\n");