@@ -49,7 +49,9 @@ def build_and_create_debug_adapter_for_attach(self):
49
49
self .build_and_create_debug_adapter (dictionary = {"EXE" : unique_name })
50
50
return self .getBuildArtifact (unique_name )
51
51
52
- def set_source_breakpoints (self , source_path , lines , data = None , wait_for_resolve = True ):
52
+ def set_source_breakpoints (
53
+ self , source_path , lines , data = None , wait_for_resolve = True
54
+ ):
53
55
"""Sets source breakpoints and returns an array of strings containing
54
56
the breakpoint IDs ("1", "2") for each breakpoint that was set.
55
57
Parameter data is array of data objects for breakpoints.
@@ -83,7 +85,9 @@ def set_source_breakpoints_assembly(self, source_reference, lines, data=None):
83
85
breakpoint_ids .append ("%i" % (breakpoint ["id" ]))
84
86
return breakpoint_ids
85
87
86
- def set_function_breakpoints (self , functions , condition = None , hitCondition = None , wait_for_resolve = True ):
88
+ def set_function_breakpoints (
89
+ self , functions , condition = None , hitCondition = None , wait_for_resolve = True
90
+ ):
87
91
"""Sets breakpoints by function name given an array of function names
88
92
and returns an array of strings containing the breakpoint IDs
89
93
("1", "2") for each breakpoint that was set.
@@ -100,24 +104,36 @@ def set_function_breakpoints(self, functions, condition=None, hitCondition=None,
100
104
if wait_for_resolve :
101
105
self .wait_for_breakpoints_to_resolve (breakpoint_ids , timeout = 10 )
102
106
return breakpoint_ids
103
-
104
- def wait_for_breakpoints_to_resolve (self , breakpoint_ids : list [str ], timeout : Optional [float ] = None ):
107
+
108
+ def wait_for_breakpoints_to_resolve (
109
+ self , breakpoint_ids : list [str ], timeout : Optional [float ] = None
110
+ ):
105
111
unresolved_breakpoints = set (breakpoint_ids )
106
-
112
+
107
113
# Check already resolved breakpoints
108
- resolved_breakpoints = self .dap_server .request_testGetTargetBreakpoints (only_resolved = True )["body" ]["breakpoints" ]
114
+ resolved_breakpoints = self .dap_server .request_testGetTargetBreakpoints (
115
+ only_resolved = True
116
+ )["body" ]["breakpoints" ]
109
117
for resolved_breakpoint in resolved_breakpoints :
110
118
unresolved_breakpoints .discard (str (resolved_breakpoint ["id" ]))
111
119
112
120
while len (unresolved_breakpoints ) > 0 :
113
- breakpoint_event = self .dap_server .wait_for_event ("breakpoint" , timeout = timeout )
121
+ breakpoint_event = self .dap_server .wait_for_event (
122
+ "breakpoint" , timeout = timeout
123
+ )
114
124
if breakpoint_event is None :
115
125
break
116
126
117
127
if breakpoint_event ["body" ]["reason" ] in ["changed" , "new" ]:
118
- unresolved_breakpoints .discard (str (breakpoint_event ["body" ]["breakpoint" ]["id" ]))
128
+ unresolved_breakpoints .discard (
129
+ str (breakpoint_event ["body" ]["breakpoint" ]["id" ])
130
+ )
119
131
120
- self .assertEqual (len (unresolved_breakpoints ), 0 , f"Expected to resolve all breakpoints. Unresolved breakpoint ids: { unresolved_breakpoints } " )
132
+ self .assertEqual (
133
+ len (unresolved_breakpoints ),
134
+ 0 ,
135
+ f"Expected to resolve all breakpoints. Unresolved breakpoint ids: { unresolved_breakpoints } " ,
136
+ )
121
137
122
138
def waitUntil (self , condition_callback ):
123
139
for _ in range (20 ):
0 commit comments