diff options
author | Greg Clayton <gclayton@apple.com> | 2018-12-19 18:16:52 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2018-12-19 18:16:52 +0000 |
commit | da9c5dba961d8f110022400ef81faf0f4bc93ffc (patch) | |
tree | 16dd5aa96e0b11ee8088ad9146f8eae502a3ab7b /lldb/packages/Python/lldbsuite/test | |
parent | ce90181751246f240302a930ca853cb5b1fb95c5 (diff) | |
download | bcm5719-llvm-da9c5dba961d8f110022400ef81faf0f4bc93ffc.tar.gz bcm5719-llvm-da9c5dba961d8f110022400ef81faf0f4bc93ffc.zip |
Show the memory region name if there is one in the output of the "memory region" command
Prior to this change we would show the name of the section that a memory region belonged to but not its actual region name. Now we show this,. Added a test that reuses the regions-linux-map.dmp minidump file to test this and verify the correct region names for various memory regions.
Differential Revision: https://reviews.llvm.org/D55854
llvm-svn: 349658
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
2 files changed, 30 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py index de06942d35c..3f4b29241c8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py @@ -88,6 +88,36 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid) self.check_state() + def test_memory_region_name(self): + self.dbg.CreateTarget(None) + self.target = self.dbg.GetSelectedTarget() + self.process = self.target.LoadCore("regions-linux-map.dmp") + result = lldb.SBCommandReturnObject() + addr_region_name_pairs = [ + ("0x400d9000", "/system/bin/app_process"), + ("0x400db000", "/system/bin/app_process"), + ("0x400dd000", "/system/bin/linker"), + ("0x400ed000", "/system/bin/linker"), + ("0x400ee000", "/system/bin/linker"), + ("0x400fb000", "/system/lib/liblog.so"), + ("0x400fc000", "/system/lib/liblog.so"), + ("0x400fd000", "/system/lib/liblog.so"), + ("0x400ff000", "/system/lib/liblog.so"), + ("0x40100000", "/system/lib/liblog.so"), + ("0x40101000", "/system/lib/libc.so"), + ("0x40122000", "/system/lib/libc.so"), + ("0x40123000", "/system/lib/libc.so"), + ("0x40167000", "/system/lib/libc.so"), + ("0x40169000", "/system/lib/libc.so"), + ] + ci = self.dbg.GetCommandInterpreter() + for (addr, region_name) in addr_region_name_pairs: + command = 'memory region ' + addr + ci.HandleCommand(command, result, False) + message = 'Ensure memory "%s" shows up in output for "%s"' % ( + region_name, command) + self.assertTrue(region_name in result.GetOutput(), message) + def test_modules_in_mini_dump(self): """Test that lldb can read the list of modules from the minidump.""" # target create -c linux-x86_64.dmp diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.dmp Binary files differnew file mode 100644 index 00000000000..3f1dd53d98f --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.dmp |