aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/memory_mapped_file.h
diff options
context:
space:
mode:
authorrmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-07-22 11:34:11 +0000
committerrmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-07-22 11:34:11 +0000
commit561f81873562d407ac1c39144b30e26163e0045d (patch)
tree7f2c072ddac47a40a34e46a36784dfcdd4fc411e /src/common/linux/memory_mapped_file.h
parentBoth std::tr1::unordered_set and std::unordered_set are not allowed in (diff)
downloadbreakpad-561f81873562d407ac1c39144b30e26163e0045d.tar.xz
Chrome on Android now supports loading the shared library directly from the APK file.
This patch makes two changes to breakpad to enable crash reporting to work correctly when the library is inside another file (an archive): - Do not filter mappings which map an executable at a non-zero offset. - If such an executable is mapped look in the ELF information for the shared object name and use that name in the minidump. Note this change doesn't care about the archive format and isn't Android specific (though loading the shared library this way is currently only done on Android). BUG=390618 R=thestig@chromium.org Review URL: https://breakpad.appspot.com/7684002 Patch from Anton Carver <anton@chromium.org>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1355 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/memory_mapped_file.h')
-rw-r--r--src/common/linux/memory_mapped_file.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/linux/memory_mapped_file.h b/src/common/linux/memory_mapped_file.h
index 6abd5b0c..fa660cc9 100644
--- a/src/common/linux/memory_mapped_file.h
+++ b/src/common/linux/memory_mapped_file.h
@@ -33,6 +33,7 @@
#ifndef COMMON_LINUX_MEMORY_MAPPED_FILE_H_
#define COMMON_LINUX_MEMORY_MAPPED_FILE_H_
+#include <stddef.h>
#include "common/basictypes.h"
#include "common/memory_range.h"
@@ -47,7 +48,7 @@ class MemoryMappedFile {
// Constructor that calls Map() to map a file at |path| into memory.
// If Map() fails, the object behaves as if it is default constructed.
- explicit MemoryMappedFile(const char* path);
+ MemoryMappedFile(const char* path, size_t offset);
~MemoryMappedFile();
@@ -56,7 +57,7 @@ class MemoryMappedFile {
// success. Mapping an empty file will succeed but with data() and size()
// returning NULL and 0, respectively. An existing mapping is unmapped
// before a new mapping is created.
- bool Map(const char* path);
+ bool Map(const char* path, size_t offset);
// Unmaps the memory for the mapped file. It's a no-op if no file is
// mapped.