1 """Test that lldb can report the exception reason for threads in a corefile."""
8 from lldbsuite
.test
.decorators
import *
9 from lldbsuite
.test
.lldbtest
import *
10 from lldbsuite
.test
import lldbutil
13 class TestCorefileExceptionReason(TestBase
):
14 @skipIfOutOfTreeDebugserver # newer debugserver required for these qMemoryRegionInfo types
17 @skipIf(archs
=no_match(["arm64", "arm64e"]))
20 corefile
= self
.getBuildArtifact("process.core")
22 (target
, process
, thread
, bkpt
) = lldbutil
.run_to_source_breakpoint(
23 self
, "// break here", lldb
.SBFileSpec("main.cpp")
26 self
.runCmd("continue")
28 self
.runCmd("process save-core -s stack " + corefile
)
31 self
.runCmd("thread list")
32 for t
in process
.threads
:
33 live_tids
.append(t
.GetThreadID())
35 self
.dbg
.DeleteTarget(target
)
37 # Now load the corefile
38 target
= self
.dbg
.CreateTarget("")
39 process
= target
.LoadCore(corefile
)
40 thread
= process
.GetSelectedThread()
41 self
.assertTrue(process
.GetSelectedThread().IsValid())
43 self
.runCmd("image list")
48 thread
.GetStopDescription(256), "ESR_EC_DABORT_EL0 (fault address: 0x0)"
52 self
.runCmd("thread list")
53 for i
in range(process
.GetNumThreads()):
54 t
= process
.GetThreadAtIndex(i
)
55 self
.assertEqual(t
.GetThreadID(), live_tids
[i
])