From 02c244f1b29baf8dd519a1175fb19df0cdb99a0f Mon Sep 17 00:00:00 2001 From: nealsid Date: Thu, 26 Feb 2009 21:31:53 +0000 Subject: Fix for issue 242, plus a redo of how old exception handlers are tracked, and called. R=Craig.Schlenter, luly81 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@315 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/handler/exception_handler.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/client/linux/handler/exception_handler.h') diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index 6e6156c5..6ea09a11 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -36,6 +36,7 @@ #include #include +#include #include #include "client/linux/handler/minidump_generator.h" @@ -146,6 +147,8 @@ class ExceptionHandler { void SetupHandler(int signo); // Teardown the handler for a signal. void TeardownHandler(int signo); + // Teardown the handler for a signal. + void TeardownHandler(int signo, struct sigaction *old); // Teardown all handlers. void TeardownAllHandler(); @@ -192,10 +195,6 @@ class ExceptionHandler { // when created (with an install_handler parameter set to true). bool installed_handler_; - // Keep the previous handlers for the signal. - typedef void (*sighandler_t)(int); - std::map old_handlers_; - // The global exception handler stack. This is need becuase there may exist // multiple ExceptionHandler instances in a process. Each will have itself // registered in this stack. @@ -210,6 +209,16 @@ class ExceptionHandler { // disallow copy ctor and operator= explicit ExceptionHandler(const ExceptionHandler &); void operator=(const ExceptionHandler &); + + // The sigactions structure we use for each signal + struct sigaction act_; + + + // Keep the previous handlers for the signal. + // We're wasting a bit of memory here since we only change + // the handler for some signals but i want to avoid allocating + // memory in the signal handler + struct sigaction old_actions_[NSIG]; }; } // namespace google_breakpad -- cgit v1.2.1