[Lldb-commits] [PATCH] D55854: Show the memory region name if there is one in the output of the "memory region" command
Phabricator via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 19 10:20:15 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB349658: Show the memory region name if there is one in the output of the "memory… (authored by gclayton, committed by ).
Herald added a subscriber: abidh.
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55854/new/
https://reviews.llvm.org/D55854
Files:
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.dmp
source/Commands/CommandObjectMemory.cpp
Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -88,6 +88,36 @@
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
Index: source/Commands/CommandObjectMemory.cpp
===================================================================
--- source/Commands/CommandObjectMemory.cpp
+++ source/Commands/CommandObjectMemory.cpp
@@ -1723,6 +1723,7 @@
error = process_sp->GetMemoryRegionInfo(load_addr, range_info);
if (error.Success()) {
lldb_private::Address addr;
+ ConstString name = range_info.GetName();
ConstString section_name;
if (process_sp->GetTarget().ResolveLoadAddress(load_addr, addr)) {
SectionSP section_sp(addr.GetSection());
@@ -1734,13 +1735,14 @@
}
}
result.AppendMessageWithFormat(
- "[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") %c%c%c%s%s\n",
+ "[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") %c%c%c%s%s%s%s\n",
range_info.GetRange().GetRangeBase(),
range_info.GetRange().GetRangeEnd(),
range_info.GetReadable() ? 'r' : '-',
range_info.GetWritable() ? 'w' : '-',
- range_info.GetExecutable() ? 'x' : '-', section_name ? " " : "",
- section_name ? section_name.AsCString() : "");
+ range_info.GetExecutable() ? 'x' : '-',
+ name ? " " : "", name.AsCString(""),
+ section_name ? " " : "", section_name.AsCString(""));
m_prev_end_addr = range_info.GetRange().GetRangeEnd();
result.SetStatus(eReturnStatusSuccessFinishResult);
} else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55854.178914.patch
Type: text/x-patch
Size: 3639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181219/04e36250/attachment-0001.bin>
More information about the lldb-commits
mailing list