11
11
class TestStepOverWatchpoint (TestBase ):
12
12
NO_DEBUG_INFO_TESTCASE = True
13
13
14
- @expectedFailureAll (
15
- oslist = ["freebsd" , "linux" ],
16
- archs = [
17
- 'aarch64' ,
18
- 'arm' ],
19
- bugnumber = "llvm.org/pr26031" )
20
- # Read-write watchpoints not supported on SystemZ
21
- @expectedFailureAll (archs = ['s390x' ])
22
- @expectedFailureAll (
23
- oslist = ["ios" , "watchos" , "tvos" , "bridgeos" , "macosx" ],
24
- archs = ['aarch64' , 'arm' ],
25
- bugnumber = "<rdar://problem/34027183>" )
26
- @add_test_categories (["basic_process" ])
27
- def test (self ):
14
+ def get_to_start (self , bkpt_text ):
28
15
"""Test stepping over watchpoints."""
29
16
self .build ()
30
- target = self .createTestTarget ()
31
-
32
- lldbutil .run_break_set_by_symbol (self , 'main' )
33
-
34
- process = target .LaunchSimple (None , None ,
35
- self .get_process_working_directory ())
36
- self .assertTrue (process .IsValid (), PROCESS_IS_VALID )
37
- self .assertState (process .GetState (), lldb .eStateStopped ,
38
- PROCESS_STOPPED )
39
-
40
- thread = lldbutil .get_stopped_thread (process ,
41
- lldb .eStopReasonBreakpoint )
42
- self .assertTrue (thread .IsValid (), "Failed to get thread." )
43
-
17
+ target , process , thread , bkpt = lldbutil .run_to_source_breakpoint (self , bkpt_text ,
18
+ lldb .SBFileSpec ("main.c" ))
44
19
frame = thread .GetFrameAtIndex (0 )
45
20
self .assertTrue (frame .IsValid (), "Failed to get frame." )
46
21
@@ -55,14 +30,45 @@ def test(self):
55
30
self .assertSuccess (error , "Error while setting watchpoint" )
56
31
self .assertTrue (read_watchpoint , "Failed to set read watchpoint." )
57
32
33
+ # Disable the breakpoint we hit so we don't muddy the waters with
34
+ # stepping off from the breakpoint:
35
+ bkpt .SetEnabled (False )
36
+
37
+ return (target , process , thread , read_watchpoint )
38
+
39
+ @expectedFailureAll (
40
+ oslist = ["freebsd" , "linux" ],
41
+ archs = [
42
+ 'aarch64' ,
43
+ 'arm' ],
44
+ bugnumber = "llvm.org/pr26031" )
45
+ # Read-write watchpoints not supported on SystemZ
46
+ @expectedFailureAll (archs = ['s390x' ])
47
+ @add_test_categories (["basic_process" ])
48
+ def test_step_over (self ):
49
+ target , process , thread , wp = self .get_to_start ("Set a breakpoint here" )
50
+
58
51
thread .StepOver ()
59
52
self .assertStopReason (thread .GetStopReason (), lldb .eStopReasonWatchpoint ,
60
53
STOPPED_DUE_TO_WATCHPOINT )
61
54
self .assertEquals (thread .GetStopDescription (20 ), 'watchpoint 1' )
62
55
63
- process .Continue ()
64
- self .assertState (process .GetState (), lldb .eStateStopped ,
65
- PROCESS_STOPPED )
56
+ @expectedFailureAll (
57
+ oslist = ["freebsd" , "linux" ],
58
+ archs = [
59
+ 'aarch64' ,
60
+ 'arm' ],
61
+ bugnumber = "llvm.org/pr26031" )
62
+ # Read-write watchpoints not supported on SystemZ
63
+ @expectedFailureAll (archs = ['s390x' ])
64
+ @expectedFailureAll (
65
+ oslist = ["ios" , "watchos" , "tvos" , "bridgeos" , "macosx" ],
66
+ archs = ['aarch64' , 'arm' ],
67
+ bugnumber = "<rdar://problem/34027183>" )
68
+ @add_test_categories (["basic_process" ])
69
+ def test_step_instruction (self ):
70
+ target , process , thread , wp = self .get_to_start ("Set breakpoint after call" )
71
+
66
72
self .assertEquals (thread .GetStopDescription (20 ), 'step over' )
67
73
68
74
self .step_inst_for_watchpoint (1 )
0 commit comments