summaryrefslogtreecommitdiffstats
path: root/lldb/include
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-07-22 12:55:35 +0000
committerTamas Berghammer <tberghammer@google.com>2016-07-22 12:55:35 +0000
commitd7d69f80836c8485c83ba55d2e5e5bac4154d975 (patch)
treecf5d46fb847e559bcfaaaf892a908de4a9736aa4 /lldb/include
parent29333c9de6c7ab6ad1ca09d19d011927704db0c5 (diff)
downloadbcm5719-llvm-d7d69f80836c8485c83ba55d2e5e5bac4154d975.tar.gz
bcm5719-llvm-d7d69f80836c8485c83ba55d2e5e5bac4154d975.zip
Support loading files even when incorrect file name specified by the linker
"Incorrect" file name seen on Android whene the main executable is called "app_process32" (or 64) but the linker specifies the package name (e.g. com.android.calculator2). Additionally it can be present in case of some linker bugs. This CL adds logic to try to fetch the correct file name from the proc file system based on the base address sepcified by the linker in case we are failed to load the module by name. Differential revision: http://reviews.llvm.org/D22219 llvm-svn: 276411
Diffstat (limited to 'lldb/include')
-rw-r--r--lldb/include/lldb/API/SBMemoryRegionInfo.h13
-rw-r--r--lldb/include/lldb/Target/MemoryRegionInfo.h14
2 files changed, 27 insertions, 0 deletions
diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h
index fadd0760891..16b767ff233 100644
--- a/lldb/include/lldb/API/SBMemoryRegionInfo.h
+++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h
@@ -86,6 +86,19 @@ public:
bool
IsMapped ();
+
+ //------------------------------------------------------------------
+ /// Returns the name of the memory region mapped at the given
+ /// address.
+ ///
+ /// @return
+ /// In case of memory mapped files it is the absolute path of
+ /// the file otherwise it is a name associated with the memory
+ /// region. If no name can be determined the returns nullptr.
+ //------------------------------------------------------------------
+ const char *
+ GetName();
+
bool
operator == (const lldb::SBMemoryRegionInfo &rhs) const;
diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h
index 5c82a1f294d..9c042905ef7 100644
--- a/lldb/include/lldb/Target/MemoryRegionInfo.h
+++ b/lldb/include/lldb/Target/MemoryRegionInfo.h
@@ -10,6 +10,7 @@
#ifndef lldb_MemoryRegionInfo_h
#define lldb_MemoryRegionInfo_h
+#include "lldb/Core/ConstString.h"
#include "lldb/Core/RangeMap.h"
#include "lldb/Utility/Range.h"
@@ -81,6 +82,12 @@ namespace lldb_private
{
return m_mapped;
}
+
+ const ConstString&
+ GetName () const
+ {
+ return m_name;
+ }
void
SetReadable (OptionalBool val)
@@ -106,6 +113,12 @@ namespace lldb_private
m_mapped = val;
}
+ void
+ SetName (const char* name)
+ {
+ m_name = ConstString(name);
+ }
+
//----------------------------------------------------------------------
// Get permissions as a uint32_t that is a mask of one or more bits from
// the lldb::Permissions
@@ -157,6 +170,7 @@ namespace lldb_private
OptionalBool m_write;
OptionalBool m_execute;
OptionalBool m_mapped;
+ ConstString m_name;
};
}
OpenPOWER on IntegriCloud