From 94454927f697840a25c1ae73ebbcf9a5324b9060 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 20 Jun 2019 07:13:26 +0800 Subject: process: split routines used to enhance fatal exception stack traces Previously the enhancement were done right after emitting `'uncaughtException'`, which meant by the time we knew the exception was fatal in C++, the error.stack had already been patched. This patch moves those routines to be called later during the fatal exception handling, and split them into two stages: before and after the inspector is notified by the invocation of `V8Inspector::exceptionThrown`. We now expand the stack to include additional informations about unhandled 'error' events before the inspector is notified, but delay the highlighting of the frames until after the inspector is notified, so that the ANSI escape sequences won't show up in the inspector console. PR-URL: https://github.com/nodejs/node/pull/28308 Fixes: https://github.com/nodejs/node/issues/28287 Reviewed-By: Benjamin Gruenbaum --- src/inspector_agent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/inspector_agent.h') diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 1c2bde0da7..5447a68485 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -65,8 +65,8 @@ class Agent { void WaitForConnect(); // Blocks till all the sessions with "WaitForDisconnectOnShutdown" disconnect void WaitForDisconnect(); - void FatalException(v8::Local error, - v8::Local message); + void ReportUncaughtException(v8::Local error, + v8::Local message); // Async stack traces instrumentation. void AsyncTaskScheduled(const v8_inspector::StringView& taskName, void* task, -- cgit v1.2.1