diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2016-07-22 12:55:35 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2016-07-22 12:55:35 +0000 |
| commit | d7d69f80836c8485c83ba55d2e5e5bac4154d975 (patch) | |
| tree | cf5d46fb847e559bcfaaaf892a908de4a9736aa4 /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
| parent | 29333c9de6c7ab6ad1ca09d19d011927704db0c5 (diff) | |
| download | llvm-d7d69f80836c8485c83ba55d2e5e5bac4154d975.zip llvm-d7d69f80836c8485c83ba55d2e5e5bac4154d975.tar.gz llvm-d7d69f80836c8485c83ba55d2e5e5bac4154d975.tar.bz2 | |
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/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index ae32a77..6d822ce 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1678,6 +1678,20 @@ ParseMemoryRegionInfoFromProcMapsLine (const std::string &maps_line, MemoryRegio else return Error ("unexpected /proc/{pid}/maps exec permission char"); + line_extractor.GetChar(); // Read the private bit + line_extractor.SkipSpaces(); // Skip the separator + line_extractor.GetHexMaxU64(false, 0); // Read the offset + line_extractor.GetHexMaxU64(false, 0); // Read the major device number + line_extractor.GetChar(); // Read the device id separator + line_extractor.GetHexMaxU64(false, 0); // Read the major device number + line_extractor.SkipSpaces(); // Skip the separator + line_extractor.GetU64(0, 10); // Read the inode number + + line_extractor.SkipSpaces(); + const char* name = line_extractor.Peek(); + if (name) + memory_region_info.SetName(name); + return Error (); } |
