aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler/exception_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/linux/handler/exception_handler.cc')
-rw-r--r--src/client/linux/handler/exception_handler.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index b895f6d7..0d7cd9cf 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -213,6 +213,7 @@ pthread_mutex_t g_handler_stack_mutex_ = PTHREAD_MUTEX_INITIALIZER;
ExceptionHandler::CrashContext g_crash_context_;
FirstChanceHandler g_first_chance_handler_ = nullptr;
+FirstChanceHandlerDeprecated g_first_chance_handler_deprecated_ = nullptr;
} // namespace
// Runs before crashing: normal context.
@@ -338,6 +339,11 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
return;
}
+ if (g_first_chance_handler_deprecated_ != nullptr &&
+ g_first_chance_handler_deprecated_(sig, info, uc)) {
+ return;
+ }
+
// All the exception signals are blocked at this point.
pthread_mutex_lock(&g_handler_stack_mutex_);
@@ -791,7 +797,13 @@ bool ExceptionHandler::WriteMinidumpForChild(pid_t child,
}
void SetFirstChanceExceptionHandler(FirstChanceHandler callback) {
+ g_first_chance_handler_deprecated_ = nullptr;
g_first_chance_handler_ = callback;
}
+void SetFirstChanceExceptionHandler(FirstChanceHandlerDeprecated callback) {
+ g_first_chance_handler_ = nullptr;
+ g_first_chance_handler_deprecated_ = callback;
+}
+
} // namespace google_breakpad