2 Test handling of cases when a single instruction triggers multiple watchpoints
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class MultipleHitsTestCase(TestBase
):
13 NO_DEBUG_INFO_TESTCASE
= True
16 bugnumber
="llvm.org/pr30758",
18 archs
=["arm", "aarch64", "powerpc64le"],
23 target
= self
.createTestTarget()
25 bp
= target
.BreakpointCreateByName("main")
26 self
.assertTrue(bp
and bp
.IsValid(), "Breakpoint is valid")
28 process
= target
.LaunchSimple(None, None, self
.get_process_working_directory())
29 self
.assertState(process
.GetState(), lldb
.eStateStopped
)
31 thread
= lldbutil
.get_stopped_thread(process
, lldb
.eStopReasonBreakpoint
)
32 self
.assertIsNotNone(thread
)
34 frame
= thread
.GetFrameAtIndex(0)
35 self
.assertTrue(frame
and frame
.IsValid(), "Frame is valid")
37 buf
= frame
.FindValue("buf", lldb
.eValueTypeVariableGlobal
)
38 self
.assertTrue(buf
and buf
.IsValid(), "buf is valid")
40 for i
in [0, target
.GetAddressByteSize()]:
41 member
= buf
.GetChildAtIndex(i
)
42 self
.assertTrue(member
and member
.IsValid(), "member is valid")
44 error
= lldb
.SBError()
45 watch
= member
.Watch(True, True, True, error
)
46 self
.assertSuccess(error
)
49 self
.assertState(process
.GetState(), lldb
.eStateStopped
)
50 self
.assertStopReason(thread
.GetStopReason(), lldb
.eStopReasonWatchpoint
)