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/common | |
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/common')
-rw-r--r-- | src/common/memory.h (renamed from src/common/linux/memory.h) | 13 | ||||
-rw-r--r-- | src/common/memory_unittest.cc (renamed from src/common/linux/memory_unittest.cc) | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/common/linux/memory.h b/src/common/memory.h index 868c9cc0..a02ac578 100644 --- a/src/common/linux/memory.h +++ b/src/common/memory.h @@ -27,15 +27,22 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CLIENT_LINUX_HANDLER_MEMORY_H_ -#define CLIENT_LINUX_HANDLER_MEMORY_H_ +#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_ +#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_ #include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> +#ifdef __APPLE__ +#define sys_mmap mmap +#define sys_mmap2 mmap +#define sys_munmap munmap +#define MAP_ANONYMOUS MAP_ANON +#else #include "third_party/lss/linux_syscall_support.h" +#endif namespace google_breakpad { @@ -196,4 +203,4 @@ inline void* operator new(size_t nbytes, return allocator.Alloc(nbytes); } -#endif // CLIENT_LINUX_HANDLER_MEMORY_H_ +#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_ diff --git a/src/common/linux/memory_unittest.cc b/src/common/memory_unittest.cc index 66c83465..8b2ec410 100644 --- a/src/common/linux/memory_unittest.cc +++ b/src/common/memory_unittest.cc @@ -27,7 +27,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "common/linux/memory.h" +#include "common/memory.h" #include "testing/gtest/include/gtest/gtest.h" using namespace google_breakpad; @@ -74,7 +74,7 @@ TEST(WastefulVectorTest, Setup) { TEST(WastefulVectorTest, Simple) { PageAllocator allocator_; - wasteful_vector<int> v(&allocator_); + wasteful_vector<unsigned> v(&allocator_); for (unsigned i = 0; i < 256; ++i) v.push_back(i); |