Skip to content

Commit 3f08a36

Browse files
committed
python format
1 parent 542fd2a commit 3f08a36

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def build_and_create_debug_adapter_for_attach(self):
4848
self.build_and_create_debug_adapter(dictionary={"EXE": unique_name})
4949
return self.getBuildArtifact(unique_name)
5050

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+
):
5254
"""Sets source breakpoints and returns an array of strings containing
5355
the breakpoint IDs ("1", "2") for each breakpoint that was set.
5456
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
6668
self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10)
6769
return breakpoint_ids
6870

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+
):
7074
"""Sets breakpoints by function name given an array of function names
7175
and returns an array of strings containing the breakpoint IDs
7276
("1", "2") for each breakpoint that was set.
@@ -83,24 +87,36 @@ def set_function_breakpoints(self, functions, condition=None, hitCondition=None,
8387
if wait_for_resolve:
8488
self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10)
8589
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+
):
8894
unresolved_breakpoints = set(breakpoint_ids)
89-
95+
9096
# 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"]
92100
for resolved_breakpoint in resolved_breakpoints:
93101
unresolved_breakpoints.discard(str(resolved_breakpoint["id"]))
94102

95103
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+
)
97107
if breakpoint_event is None:
98108
break
99109

100110
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+
)
102114

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+
)
104120

105121
def waitUntil(self, condition_callback):
106122
for _ in range(20):

lldb/test/API/tools/lldb-dap/module/TestDAP_module.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ def run_test(self, symbol_basename, expect_debug_info_size):
1616
program = self.getBuildArtifact(program_basename)
1717
self.build_and_launch(program)
1818
functions = ["foo"]
19-
19+
2020
# This breakpoint will be resolved only when the libfoo module is loaded
21-
breakpoint_ids = self.set_function_breakpoints(functions, wait_for_resolve=False)
21+
breakpoint_ids = self.set_function_breakpoints(
22+
functions, wait_for_resolve=False
23+
)
2224
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
2325
self.continue_to_breakpoints(breakpoint_ids)
2426
active_modules = self.dap_server.get_modules()

lldb/test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ def test_terminated_event(self):
3535
self.build_and_launch(program)
3636
# Set breakpoints
3737
functions = ["foo"]
38-
38+
3939
# This breakpoint will be resolved only when the libfoo module is loaded
40-
breakpoint_ids = self.set_function_breakpoints(functions, wait_for_resolve=False)
40+
breakpoint_ids = self.set_function_breakpoints(
41+
functions, wait_for_resolve=False
42+
)
4143
self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint")
4244
main_bp_line = line_number("main.cpp", "// main breakpoint 1")
43-
breakpoint_ids.append(self.set_source_breakpoints("main.cpp", [main_bp_line], wait_for_resolve=False))
45+
breakpoint_ids.append(
46+
self.set_source_breakpoints(
47+
"main.cpp", [main_bp_line], wait_for_resolve=False
48+
)
49+
)
4450

4551
self.continue_to_breakpoints(breakpoint_ids)
4652
self.continue_to_exit()

0 commit comments

Comments
 (0)