@@ -48,7 +48,9 @@ def build_and_create_debug_adapter_for_attach(self):
48
48
self .build_and_create_debug_adapter (dictionary = {"EXE" : unique_name })
49
49
return self .getBuildArtifact (unique_name )
50
50
51
- def set_source_breakpoints (self , source_path , lines , data = None , wait_for_resolve = True ):
51
+ def set_source_breakpoints (
52
+ self , source_path , lines , data = None , wait_for_resolve = True
53
+ ):
52
54
"""Sets source breakpoints and returns an array of strings containing
53
55
the breakpoint IDs ("1", "2") for each breakpoint that was set.
54
56
Parameter data is array of data objects for breakpoints.
@@ -66,7 +68,9 @@ def set_source_breakpoints(self, source_path, lines, data=None, wait_for_resolve
66
68
self .wait_for_breakpoints_to_resolve (breakpoint_ids , timeout = 10 )
67
69
return breakpoint_ids
68
70
69
- def set_function_breakpoints (self , functions , condition = None , hitCondition = None , wait_for_resolve = True ):
71
+ def set_function_breakpoints (
72
+ self , functions , condition = None , hitCondition = None , wait_for_resolve = True
73
+ ):
70
74
"""Sets breakpoints by function name given an array of function names
71
75
and returns an array of strings containing the breakpoint IDs
72
76
("1", "2") for each breakpoint that was set.
@@ -83,24 +87,36 @@ def set_function_breakpoints(self, functions, condition=None, hitCondition=None,
83
87
if wait_for_resolve :
84
88
self .wait_for_breakpoints_to_resolve (breakpoint_ids , timeout = 10 )
85
89
return breakpoint_ids
86
-
87
- def wait_for_breakpoints_to_resolve (self , breakpoint_ids : list [str ], timeout : Optional [float ] = None ):
90
+
91
+ def wait_for_breakpoints_to_resolve (
92
+ self , breakpoint_ids : list [str ], timeout : Optional [float ] = None
93
+ ):
88
94
unresolved_breakpoints = set (breakpoint_ids )
89
-
95
+
90
96
# Check already resolved breakpoints
91
- resolved_breakpoints = self .dap_server .request_testGetTargetBreakpoints (only_resolved = True )["body" ]["breakpoints" ]
97
+ resolved_breakpoints = self .dap_server .request_testGetTargetBreakpoints (
98
+ only_resolved = True
99
+ )["body" ]["breakpoints" ]
92
100
for resolved_breakpoint in resolved_breakpoints :
93
101
unresolved_breakpoints .discard (str (resolved_breakpoint ["id" ]))
94
102
95
103
while len (unresolved_breakpoints ) > 0 :
96
- breakpoint_event = self .dap_server .wait_for_event ("breakpoint" , timeout = timeout )
104
+ breakpoint_event = self .dap_server .wait_for_event (
105
+ "breakpoint" , timeout = timeout
106
+ )
97
107
if breakpoint_event is None :
98
108
break
99
109
100
110
if breakpoint_event ["body" ]["reason" ] in ["changed" , "new" ]:
101
- unresolved_breakpoints .discard (str (breakpoint_event ["body" ]["breakpoint" ]["id" ]))
111
+ unresolved_breakpoints .discard (
112
+ str (breakpoint_event ["body" ]["breakpoint" ]["id" ])
113
+ )
102
114
103
- self .assertEqual (len (unresolved_breakpoints ), 0 , f"Expected to resolve all breakpoints. Unresolved breakpoint ids: { unresolved_breakpoints } " )
115
+ self .assertEqual (
116
+ len (unresolved_breakpoints ),
117
+ 0 ,
118
+ f"Expected to resolve all breakpoints. Unresolved breakpoint ids: { unresolved_breakpoints } " ,
119
+ )
104
120
105
121
def waitUntil (self , condition_callback ):
106
122
for _ in range (20 ):
0 commit comments