Skip to content

Commit 6937686

Browse files
committed
Fix formatting
1 parent af45bc2 commit 6937686

File tree

4 files changed

+57
-41
lines changed

4 files changed

+57
-41
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,20 +612,26 @@ def request_attach(
612612
command_dict = {"command": "attach", "type": "request", "arguments": args_dict}
613613
return self.send_recv(command_dict)
614614

615-
def request_breakpointLocations(self, file_path, line, end_line=None, column=None, end_column=None):
615+
def request_breakpointLocations(
616+
self, file_path, line, end_line=None, column=None, end_column=None
617+
):
616618
(dir, base) = os.path.split(file_path)
617619
source_dict = {"name": base, "path": file_path}
618620
args_dict = {}
619621
args_dict["source"] = source_dict
620622
if line is not None:
621-
args_dict["line"] = line
623+
args_dict["line"] = line
622624
if end_line is not None:
623625
args_dict["endLine"] = end_line
624626
if column is not None:
625627
args_dict["column"] = column
626628
if end_column is not None:
627629
args_dict["endColumn"] = end_column
628-
command_dict = {"command": "breakpointLocations", "type": "request", "arguments": args_dict}
630+
command_dict = {
631+
"command": "breakpointLocations",
632+
"type": "request",
633+
"arguments": args_dict,
634+
}
629635
return self.send_recv(command_dict)
630636

631637
def request_configurationDone(self):

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,47 +28,58 @@ def test_column_breakpoints(self):
2828
self.dap_server.request_continue()
2929

3030
# Ask for the breakpoint locations based only on the line number
31-
response = self.dap_server.request_breakpointLocations(self.main_path, loop_line)
31+
response = self.dap_server.request_breakpointLocations(
32+
self.main_path, loop_line
33+
)
3234
self.assertTrue(response["success"])
33-
self.assertEqual(response["body"]["breakpoints"], [
34-
{ "line": loop_line, "column": 9 },
35-
{ "line": loop_line, "column": 13 },
36-
{ "line": loop_line, "column": 20 },
37-
{ "line": loop_line, "column": 23 },
38-
{ "line": loop_line, "column": 25 },
39-
{ "line": loop_line, "column": 34 },
40-
{ "line": loop_line, "column": 37 },
41-
{ "line": loop_line, "column": 39 },
42-
{ "line": loop_line, "column": 51 }
43-
])
35+
self.assertEqual(
36+
response["body"]["breakpoints"],
37+
[
38+
{"line": loop_line, "column": 9},
39+
{"line": loop_line, "column": 13},
40+
{"line": loop_line, "column": 20},
41+
{"line": loop_line, "column": 23},
42+
{"line": loop_line, "column": 25},
43+
{"line": loop_line, "column": 34},
44+
{"line": loop_line, "column": 37},
45+
{"line": loop_line, "column": 39},
46+
{"line": loop_line, "column": 51},
47+
],
48+
)
4449

4550
# Ask for the breakpoint locations for a column range
4651
response = self.dap_server.request_breakpointLocations(
4752
self.main_path,
4853
loop_line,
49-
column = 24,
50-
end_column = 46,
54+
column=24,
55+
end_column=46,
5156
)
5257
self.assertTrue(response["success"])
53-
self.assertEqual(response["body"]["breakpoints"], [
54-
{ "line": loop_line, "column": 25 },
55-
{ "line": loop_line, "column": 34 },
56-
{ "line": loop_line, "column": 37 },
57-
{ "line": loop_line, "column": 39 },
58-
])
58+
self.assertEqual(
59+
response["body"]["breakpoints"],
60+
[
61+
{"line": loop_line, "column": 25},
62+
{"line": loop_line, "column": 34},
63+
{"line": loop_line, "column": 37},
64+
{"line": loop_line, "column": 39},
65+
],
66+
)
5967

6068
# Ask for the breakpoint locations for a range of line numbers
6169
response = self.dap_server.request_breakpointLocations(
6270
self.main_path,
63-
line = loop_line,
64-
end_line = loop_line + 2,
65-
column = 39,
71+
line=loop_line,
72+
end_line=loop_line + 2,
73+
column=39,
6674
)
67-
self.maxDiff=None
75+
self.maxDiff = None
6876
self.assertTrue(response["success"])
69-
self.assertEqual(response["body"]["breakpoints"], [
70-
{'column': 39, 'line': 40},
71-
{'column': 51, 'line': 40},
72-
{'column': 3, 'line': 42},
73-
{'column': 18, 'line': 42}
74-
])
77+
self.assertEqual(
78+
response["body"]["breakpoints"],
79+
[
80+
{"column": 39, "line": 40},
81+
{"column": 51, "line": 40},
82+
{"column": 3, "line": 42},
83+
{"column": 18, "line": 42},
84+
],
85+
)

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ def test_set_and_clear(self):
165165
breakpoint["id"],
166166
"verify previous breakpoints stayed the same",
167167
)
168-
self.assertTrue(
169-
breakpoint["verified"], "expect breakpoint still verified"
170-
)
168+
self.assertTrue(breakpoint["verified"], "expect breakpoint still verified")
171169

172170
# Now get the full list of breakpoints set in the target and verify
173171
# we have only 2 breakpoints set. The response above could have told
@@ -190,9 +188,7 @@ def test_set_and_clear(self):
190188
"verify previous breakpoints stayed the same",
191189
)
192190
self.assertIn(line, lines, "line expected in lines array")
193-
self.assertTrue(
194-
breakpoint["verified"], "expect breakpoint still verified"
195-
)
191+
self.assertTrue(breakpoint["verified"], "expect breakpoint still verified")
196192

197193
# Now clear all breakpoints for the source file by passing down an
198194
# empty lines array
@@ -359,7 +355,9 @@ def test_column_breakpoints(self):
359355

360356
# Set two breakpoints on the loop line at different columns.
361357
columns = [13, 39]
362-
response = self.dap_server.request_setBreakpoints(self.main_path, [loop_line, loop_line], list({"column": c} for c in columns))
358+
response = self.dap_server.request_setBreakpoints(
359+
self.main_path, [loop_line, loop_line], list({"column": c} for c in columns)
360+
)
363361

364362
# Verify the breakpoints were set correctly
365363
breakpoints = response["body"]["breakpoints"]

lldb/tools/lldb-dap/DAP.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767

6868
namespace lldb_dap {
6969

70-
typedef llvm::DenseMap<std::pair<uint32_t, uint32_t>, SourceBreakpoint> SourceBreakpointMap;
70+
typedef llvm::DenseMap<std::pair<uint32_t, uint32_t>, SourceBreakpoint>
71+
SourceBreakpointMap;
7172
typedef llvm::StringMap<FunctionBreakpoint> FunctionBreakpointMap;
7273
typedef llvm::DenseMap<lldb::addr_t, InstructionBreakpoint>
7374
InstructionBreakpointMap;

0 commit comments

Comments
 (0)