github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash darker --check --diff -r HEAD~1...HEAD lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py lldb/test/API/tools/lldb-dap/module/TestDAP_module.py lldb/test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py `````````` </details> <details> <summary> View the diff from darker here. </summary> ``````````diff --- packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py 2025-05-18 18:56:47.000000 +0000 +++ packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py 2025-05-18 19:02:49.174312 +0000 @@ -46,11 +46,13 @@ named binary.""" unique_name = str(uuid.uuid4()) self.build_and_create_debug_adapter(dictionary={"EXE": unique_name}) return self.getBuildArtifact(unique_name) - def set_source_breakpoints(self, source_path, lines, data=None, wait_for_resolve=True): + def set_source_breakpoints( + self, source_path, lines, data=None, wait_for_resolve=True + ): """Sets source breakpoints and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set. Parameter data is array of data objects for breakpoints. Each object in data is 1:1 mapping with the entry in lines. It contains optional location/hitCondition/logMessage parameters. @@ -64,11 +66,13 @@ breakpoint_ids.append("%i" % (breakpoint["id"])) if wait_for_resolve: self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10) return breakpoint_ids - def set_function_breakpoints(self, functions, condition=None, hitCondition=None, wait_for_resolve=True): + def set_function_breakpoints( + self, functions, condition=None, hitCondition=None, wait_for_resolve=True + ): """Sets breakpoints by function name given an array of function names and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set. """ response = self.dap_server.request_setFunctionBreakpoints( @@ -81,28 +85,40 @@ for breakpoint in breakpoints: breakpoint_ids.append("%i" % (breakpoint["id"])) if wait_for_resolve: self.wait_for_breakpoints_to_resolve(breakpoint_ids, timeout=10) return breakpoint_ids - - def wait_for_breakpoints_to_resolve(self, breakpoint_ids: list[str], timeout: Optional[float] = None): + + def wait_for_breakpoints_to_resolve( + self, breakpoint_ids: list[str], timeout: Optional[float] = None + ): unresolved_breakpoints = set(breakpoint_ids) - + # Check already resolved breakpoints - resolved_breakpoints = self.dap_server.request_testGetTargetBreakpoints(only_resolved=True)["body"]["breakpoints"] + resolved_breakpoints = self.dap_server.request_testGetTargetBreakpoints( + only_resolved=True + )["body"]["breakpoints"] for resolved_breakpoint in resolved_breakpoints: unresolved_breakpoints.discard(str(resolved_breakpoint["id"])) while len(unresolved_breakpoints) > 0: - breakpoint_event = self.dap_server.wait_for_event("breakpoint", timeout=timeout) + breakpoint_event = self.dap_server.wait_for_event( + "breakpoint", timeout=timeout + ) if breakpoint_event is None: break if breakpoint_event["body"]["reason"] in ["changed", "new"]: - unresolved_breakpoints.discard(str(breakpoint_event["body"]["breakpoint"]["id"])) - - self.assertEqual(len(unresolved_breakpoints), 0, f"Expected to resolve all breakpoints. Unresolved breakpoint ids: {unresolved_breakpoints}") + unresolved_breakpoints.discard( + str(breakpoint_event["body"]["breakpoint"]["id"]) + ) + + self.assertEqual( + len(unresolved_breakpoints), + 0, + f"Expected to resolve all breakpoints. Unresolved breakpoint ids: {unresolved_breakpoints}", + ) def waitUntil(self, condition_callback): for _ in range(20): if condition_callback(): return True --- test/API/tools/lldb-dap/module/TestDAP_module.py 2025-05-18 18:56:47.000000 +0000 +++ test/API/tools/lldb-dap/module/TestDAP_module.py 2025-05-18 19:02:49.351547 +0000 @@ -14,13 +14,15 @@ def run_test(self, symbol_basename, expect_debug_info_size): program_basename = "a.out.stripped" program = self.getBuildArtifact(program_basename) self.build_and_launch(program) functions = ["foo"] - + # This breakpoint will be resolved only when the libfoo module is loaded - breakpoint_ids = self.set_function_breakpoints(functions, wait_for_resolve=False) + breakpoint_ids = self.set_function_breakpoints( + functions, wait_for_resolve=False + ) self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint") self.continue_to_breakpoints(breakpoint_ids) active_modules = self.dap_server.get_modules() program_module = active_modules[program_basename] self.assertIn( --- test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py 2025-05-18 18:56:47.000000 +0000 +++ test/API/tools/lldb-dap/terminated-event/TestDAP_terminatedEvent.py 2025-05-18 19:02:49.377165 +0000 @@ -33,13 +33,15 @@ program_basename = "a.out.stripped" program = self.getBuildArtifact(program_basename) self.build_and_launch(program) # Set breakpoints functions = ["foo"] - + # This breakpoint will be resolved only when the libfoo module is loaded - breakpoint_ids = self.set_function_breakpoints(functions, wait_for_resolve=False) + breakpoint_ids = self.set_function_breakpoints( + functions, wait_for_resolve=False + ) self.assertEqual(len(breakpoint_ids), len(functions), "expect one breakpoint") main_bp_line = line_number("main.cpp", "// main breakpoint 1") breakpoint_ids.append(self.set_source_breakpoints("main.cpp", [main_bp_line])) self.continue_to_breakpoints(breakpoint_ids) `````````` </details> https://github.com/llvm/llvm-project/pull/140470 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits