diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-09-18 13:54:58 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-09-18 13:54:58 +0000 |
commit | 61d9b9ff9626bf57c68a12c53c6e4804b8ef93d8 (patch) | |
tree | c85f99a0216bb237a36c59af6f196ca79e91e418 /src/client/windows/handler/exception_handler.h | |
parent | Change an always true comparison to another conditional. Since (diff) | |
download | breakpad-61d9b9ff9626bf57c68a12c53c6e4804b8ef93d8.tar.xz |
Allow adding extra memory regions to minidump on linux/windows
A=Bill McCloskey <wmccloskey@mozilla.com>, ted, original patch from https://bugzilla.mozilla.org/show_bug.cgi?id=662646
R=mark at https://breakpad.appspot.com/450002/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1041 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/handler/exception_handler.h')
-rw-r--r-- | src/client/windows/handler/exception_handler.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h index 09f5177c..b7f1f949 100644 --- a/src/client/windows/handler/exception_handler.h +++ b/src/client/windows/handler/exception_handler.h @@ -65,6 +65,7 @@ // Disable exception handler warnings. #pragma warning( disable : 4530 ) +#include <list> #include <string> #include <vector> @@ -78,6 +79,22 @@ namespace google_breakpad { using std::vector; using std::wstring; +// These entries store a list of memory regions that the client wants included +// in the minidump. +struct AppMemory { + ULONG64 ptr; + ULONG length; + + bool operator==(const struct AppMemory& other) const { + return ptr == other.ptr; + } + + bool operator==(const void* other) const { + return ptr == reinterpret_cast<ULONG64>(other); + } +}; +typedef std::list<AppMemory> AppMemoryList; + class ExceptionHandler { public: // A callback function to run before Breakpad performs any substantial @@ -219,6 +236,11 @@ class ExceptionHandler { // Returns whether out-of-process dump generation is used or not. bool IsOutOfProcess() const { return crash_generation_client_.get() != NULL; } + // Calling RegisterAppMemory(p, len) causes len bytes starting + // at address p to be copied to the minidump when a crash happens. + void RegisterAppMemory(void* ptr, size_t length); + void UnregisterAppMemory(void* ptr); + private: friend class AutoExceptionHandler; @@ -404,6 +426,10 @@ class ExceptionHandler { // to not interfere with debuggers. bool handle_debug_exceptions_; + // Callers can request additional memory regions to be included in + // the dump. + AppMemoryList app_memory_info_; + // A stack of ExceptionHandler objects that have installed unhandled // exception filters. This vector is used by HandleException to determine // which ExceptionHandler object to route an exception to. When an |