diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-02-05 18:21:31 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-02-05 18:21:31 +0000 |
commit | f480ba116971a56d4de25ae1df2369e3d5503d16 (patch) | |
tree | 8623b5348123d092c2ac7111d9140db933c1bac1 /src/client/linux/handler/exception_handler.h | |
parent | Breakpad processor: Move STACK WIN record parsing into its own function. (diff) | |
download | breakpad-f480ba116971a56d4de25ae1df2369e3d5503d16.tar.xz |
Refactor Chrome's out-of-process Linux code into CrashGeneration{Server,Client} classes. Upstreamed from the Mozilla repository. Patch by Chris Jones <jones.chris.g@gmail.com> r=me at https://bugzilla.mozilla.org/show_bug.cgi?id=516759
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@515 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/handler/exception_handler.h')
-rw-r--r-- | src/client/linux/handler/exception_handler.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index 34ce5e19..978bb010 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -35,6 +35,11 @@ #include <signal.h> +#include "client/linux/crash_generation/crash_generation_client.h" +#include "processor/scoped_ptr.h" + +struct sigaction; + namespace google_breakpad { // ExceptionHandler @@ -116,6 +121,18 @@ class ExceptionHandler { FilterCallback filter, MinidumpCallback callback, void *callback_context, bool install_handler); + + // Creates a new ExceptionHandler instance that can attempt to + // perform out-of-process dump generation if server_fd is valid. If + // server_fd is invalid, in-process dump generation will be + // used. See the above ctor for a description of the other + // parameters. + ExceptionHandler(const std::string& dump_path, + FilterCallback filter, MinidumpCallback callback, + void* callback_context, + bool install_handler, + const int server_fd); + ~ExceptionHandler(); // Get and set the minidump path. @@ -149,7 +166,14 @@ class ExceptionHandler { struct _libc_fpstate float_state; }; + // Returns whether out-of-process dump generation is used or not. + bool IsOutOfProcess() const { + return crash_generation_client_.get() != NULL; + } + private: + void Init(const std::string &dump_path, + const int server_fd); bool InstallHandlers(); void UninstallHandlers(); void PreresolveSymbols(); @@ -166,6 +190,8 @@ class ExceptionHandler { const MinidumpCallback callback_; void* const callback_context_; + scoped_ptr<CrashGenerationClient> crash_generation_client_; + std::string dump_path_; std::string next_minidump_path_; std::string next_minidump_id_; @@ -189,9 +215,8 @@ class ExceptionHandler { static unsigned handler_stack_index_; static pthread_mutex_t handler_stack_mutex_; - // A vector of the old signal handlers. The void* is a pointer to a newly - // allocated sigaction structure to avoid pulling in too many includes. - std::vector<std::pair<int, void *> > old_handlers_; + // A vector of the old signal handlers. + std::vector<std::pair<int, struct sigaction *> > old_handlers_; }; } // namespace google_breakpad |