From d7d69f80836c8485c83ba55d2e5e5bac4154d975 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 22 Jul 2016 12:55:35 +0000 Subject: 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 --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index ae32a7777737..6d822ce200f5 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 (); } -- cgit v1.2.3