Skip to content

Commit c789b42

Browse files
committed
Address further review comments
1 parent 71a817e commit c789b42

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ def verify_breakpoint_hit(self, breakpoint_ids, timeout=DEFAULT_TIMEOUT):
176176
def verify_all_breakpoints_hit(self, breakpoint_ids, timeout=DEFAULT_TIMEOUT):
177177
"""Wait for the process we are debugging to stop, and verify we hit
178178
all of the breakpoint locations in the "breakpoint_ids" array.
179-
"breakpoint_ids" should be a list of breakpoint ID strings
180-
(["1", "2"])."""
179+
"breakpoint_ids" should be a list of int breakpoint IDs ([1, 2])."""
181180
stopped_events = self.dap_server.wait_for_stopped(timeout)
182181
for stopped_event in stopped_events:
183182
if "body" in stopped_event:
@@ -192,9 +191,7 @@ def verify_all_breakpoints_hit(self, breakpoint_ids, timeout=DEFAULT_TIMEOUT):
192191
if "hitBreakpointIds" not in body:
193192
continue
194193
hit_bps = body["hitBreakpointIds"]
195-
if all(
196-
int(breakpoint_id) in hit_bps for breakpoint_id in breakpoint_ids
197-
):
194+
if all(breakpoint_id in hit_bps for breakpoint_id in breakpoint_ids):
198195
return
199196
self.assertTrue(False, f"breakpoints not hit, stopped_events={stopped_events}")
200197

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,15 +404,18 @@ def test_hit_multiple_breakpoints(self):
404404
"""Test that if we hit multiple breakpoints at the same address, they
405405
all appear in the stop reason."""
406406
breakpoint_lines = [
407-
line_number("main.cpp", "// end of foo check"),
407+
line_number("main.cpp", "// break non-breakpointable line"),
408408
line_number("main.cpp", "// before loop"),
409409
]
410410

411411
program = self.getBuildArtifact("a.out")
412412
self.build_and_launch(program)
413413

414414
# Set a pair of breakpoints that will both resolve to the same address.
415-
breakpoint_ids = self.set_source_breakpoints(self.main_path, breakpoint_lines)
415+
breakpoint_ids = [
416+
int(bp_id)
417+
for bp_id in self.set_source_breakpoints(self.main_path, breakpoint_lines)
418+
]
416419
self.assertEqual(len(breakpoint_ids), 2, "expected two breakpoints")
417420
self.dap_server.request_continue()
418421
print(breakpoint_ids)

lldb/test/API/tools/lldb-dap/breakpoint/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main(int argc, char const *argv[]) {
3333
if (foo == nullptr) {
3434
fprintf(stderr, "%s\n", dlerror());
3535
exit(2);
36-
} // end of foo check
36+
} // break non-breakpointable line
3737
foo(12); // before loop
3838

3939
for (int i = 0; i < 10; ++i) {

0 commit comments

Comments
 (0)