summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py12
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py21
2 files changed, 33 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 18c4c348aa4..4cf4a9052d4 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
@@ -70,6 +70,17 @@ class MiniDumpNewTestCase(TestBase):
self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid)
self.check_state()
+ 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
+ self.dbg.CreateTarget(None)
+ self.target = self.dbg.GetSelectedTarget()
+ self.process = self.target.LoadCore("linux-x86_64.dmp")
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+ self.assertEqual(self.target.GetNumModules(), 9)
+ for module in self.target.modules:
+ self.assertTrue(module.IsValid())
+
def test_thread_info_in_minidump(self):
"""Test that lldb can read the thread information from the Minidump."""
# target create -c linux-x86_64.dmp
@@ -100,6 +111,7 @@ class MiniDumpNewTestCase(TestBase):
self.assertEqual(thread.GetNumFrames(), 2)
frame = thread.GetFrameAtIndex(0)
self.assertTrue(frame.IsValid())
+ self.assertTrue(frame.GetModule().IsValid())
pc = frame.GetPC()
eip = frame.FindRegister("pc")
self.assertTrue(eip.IsValid())
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
index 49ff0319746..cc677e6dcde 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -41,6 +41,26 @@ class MiniDumpTestCase(TestBase):
stop_description = thread.GetStopDescription(256)
self.assertTrue("0xc0000005" in stop_description)
+ def test_modules_in_mini_dump(self):
+ """Test that lldb can read the list of modules from the minidump."""
+ # target create -c fizzbuzz_no_heap.dmp
+ self.dbg.CreateTarget("")
+ self.target = self.dbg.GetSelectedTarget()
+ self.process = self.target.LoadCore("fizzbuzz_no_heap.dmp")
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+ expected_modules = [
+ r"C:\Windows\System32\MSVCP120D.dll",
+ r"C:\Windows\SysWOW64\kernel32.dll",
+ r"C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe",
+ r"C:\Windows\System32\MSVCR120D.dll",
+ r"C:\Windows\SysWOW64\KERNELBASE.dll",
+ r"C:\Windows\SysWOW64\ntdll.dll",
+ ]
+ self.assertEqual(self.target.GetNumModules(), len(expected_modules))
+ for module, expected in zip(self.target.modules, expected_modules):
+ self.assertTrue(module.IsValid())
+ self.assertEqual(module.file.fullpath, expected)
+
@expectedFailureAll(bugnumber="llvm.org/pr35193", hostoslist=["windows"])
def test_stack_info_in_mini_dump(self):
"""Test that we can see a trivial stack in a VS-generate mini dump."""
@@ -58,6 +78,7 @@ class MiniDumpTestCase(TestBase):
frame = thread.GetFrameAtIndex(i)
self.assertTrue(frame.IsValid())
self.assertEqual(frame.GetPC(), pc_list[i])
+ self.assertTrue(frame.GetModule().IsValid())
@skipUnlessWindows # Minidump saving works only on windows
def test_deeper_stack_in_mini_dump(self):
OpenPOWER on IntegriCloud