Skip to content

Commit c52ff0c

Browse files
author
SYNOPSYS\georgiev
committed
[LLDB/test] lldbutil check_breakpoint() - check target instance
Check test.target instance type before we attempt to get the breakpoint. This fix is suggested by 'clayborg'. Ref: https://reviews.llvm.org/D111899#inline-1090156
1 parent 976f3b3 commit c52ff0c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lldb/packages/Python/lldbsuite/test/lldbutil.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,13 @@ def check_breakpoint(
755755
expected_location_resolved - Extected resolved status for the location_id (True/False). Default - True.
756756
expected_location_hit_count - Expected hit count for the breakpoint at location_id. Must be set if the location_id parameter is set.
757757
"""
758-
759-
bkpt = test.target().FindBreakpointByID(bpno)
758+
759+
if isinstance(test.target, lldb.SBTarget):
760+
target = test.target
761+
else:
762+
target = test.target()
763+
bkpt = target.FindBreakpointByID(bpno)
764+
760765
test.assertTrue(bkpt.IsValid(), "Breakpoint is not valid.")
761766

762767
if expected_locations is not None:

0 commit comments

Comments
 (0)