2 Test basics of a mini dump taken of a 32-bit process running in WoW64
4 WoW64 is the subsystem that lets 32-bit processes run in 64-bit Windows. If you
5 capture a mini dump of a process running under WoW64 with a 64-bit debugger, you
6 end up with a dump of the WoW64 layer. In that case, LLDB must do extra work to
7 get the 32-bit register contexts.
10 from six import iteritems
14 from lldbsuite.test.decorators import *
15 from lldbsuite.test.lldbtest import *
16 from lldbsuite.test import lldbutil
19 class Wow64MiniDumpTestCase(TestBase):
21 mydir = TestBase.compute_mydir(__file__)
22 NO_DEBUG_INFO_TESTCASE = True
24 def test_wow64_mini_dump(self):
25 """Test that lldb can read the process information from the minidump."""
26 # target create -c fizzbuzz_wow64.dmp
27 target = self.dbg.CreateTarget("")
28 process = target.LoadCore("fizzbuzz_wow64.dmp")
29 self.assertTrue(process, PROCESS_IS_VALID)
30 self.assertEqual(process.GetNumThreads(), 1)
31 self.assertEqual(process.GetProcessID(), 0x1E9C)
33 def test_thread_info_in_wow64_mini_dump(self):
34 """Test that lldb can read the thread information from the minidump."""
35 # target create -c fizzbuzz_wow64.dmp
36 target = self.dbg.CreateTarget("")
37 process = target.LoadCore("fizzbuzz_wow64.dmp")
38 # This process crashed due to an access violation (0xc0000005), but the
39 # minidump doesn't have an exception record--perhaps the crash handler
41 # TODO: See if we can recover the exception information from the TEB,
42 # which, according to Windbg, has a pointer to an exception list.
44 # In the dump, none of the threads are stopped, so we cannot use
45 # lldbutil.get_stopped_thread.
46 thread = process.GetThreadAtIndex(0)
47 self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone)
49 def test_stack_info_in_wow64_mini_dump(self):
50 """Test that we can see a trivial stack in a VS-generate mini dump."""
51 # target create -c fizzbuzz_no_heap.dmp
52 target = self.dbg.CreateTarget("")
53 process = target.LoadCore("fizzbuzz_wow64.dmp")
54 self.assertGreaterEqual(process.GetNumThreads(), 1)
55 # This process crashed due to an access violation (0xc0000005), but the
56 # minidump doesn't have an exception record--perhaps the crash handler
58 # TODO: See if we can recover the exception information from the TEB,
59 # which, according to Windbg, has a pointer to an exception list.
61 # In the dump, none of the threads are stopped, so we cannot use
62 # lldbutil.get_stopped_thread.
63 thread = process.GetThreadAtIndex(0)
64 # The crash is in main, so there should be at least one frame on the
66 self.assertGreaterEqual(thread.GetNumFrames(), 1)
67 frame = thread.GetFrameAtIndex(0)
68 self.assertTrue(frame.IsValid())
70 eip = frame.FindRegister("pc")
71 self.assertTrue(eip.IsValid())
72 self.assertEqual(pc, eip.GetValueAsUnsigned())