diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-09-23 14:55:50 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-09-23 14:55:50 +0000 |
commit | 4621ee06914b2ebe963c93ea78fabf982cf670df (patch) | |
tree | ad6c7f5b0898ca5879e340fdf99772d4936e6403 /src/client/linux/minidump_writer | |
parent | Added the base exploitability module for windows. This only adds the very bas... (diff) | |
download | breakpad-4621ee06914b2ebe963c93ea78fabf982cf670df.tar.xz |
Write a window of memory around the instruction pointer from the crashing thread to the minidump on OS X.
R=nealsid at http://breakpad.appspot.com/200001/show
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@699 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/minidump_writer')
-rw-r--r-- | src/client/linux/minidump_writer/linux_dumper.h | 2 | ||||
-rw-r--r-- | src/client/linux/minidump_writer/linux_dumper_unittest.cc | 2 | ||||
-rw-r--r-- | src/client/linux/minidump_writer/minidump_writer.cc | 9 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper.h b/src/client/linux/minidump_writer/linux_dumper.h index 7a4cd3a3..b0c479a9 100644 --- a/src/client/linux/minidump_writer/linux_dumper.h +++ b/src/client/linux/minidump_writer/linux_dumper.h @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/user.h> -#include "common/linux/memory.h" +#include "common/memory.h" #include "google_breakpad/common/minidump_format.h" namespace google_breakpad { diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_dumper_unittest.cc index da454742..8cfb6004 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest.cc @@ -35,7 +35,7 @@ #include "breakpad_googletest_includes.h" #include "client/linux/minidump_writer/linux_dumper.h" #include "common/linux/file_id.h" -#include "common/linux/memory.h" +#include "common/memory.h" using namespace google_breakpad; diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 6b55ade0..d629ee81 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -662,12 +662,13 @@ class MinidumpWriter { // Try to get 128 bytes before and after the IP, but // settle for whatever's available. ip_memory_d.start_of_memory_range = - std::min(mapping.start_addr, + std::max(mapping.start_addr, uintptr_t(ip - (kIPMemorySize / 2))); + uintptr_t end_of_range = + std::min(uintptr_t(ip + (kIPMemorySize / 2)), + uintptr_t(mapping.start_addr + mapping.size)); ip_memory_d.memory.data_size = - std::min(ptrdiff_t(kIPMemorySize), - ptrdiff_t(mapping.start_addr + mapping.size - - ip_memory_d.start_of_memory_range)); + end_of_range - ip_memory_d.start_of_memory_range; break; } } |