[Lldb-commits] [lldb] c52ff0c - [LLDB/test] lldbutil check_breakpoint() - check target instance
SYNOPSYSgeorgiev via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 24 03:13:25 PST 2021
Author: SYNOPSYS\georgiev
Date: 2021-11-24T11:13:17Z
New Revision: c52ff0cfcbf46b81d3df868a259d94910cd15c9a
URL: https://github.com/llvm/llvm-project/commit/c52ff0cfcbf46b81d3df868a259d94910cd15c9a
DIFF: https://github.com/llvm/llvm-project/commit/c52ff0cfcbf46b81d3df868a259d94910cd15c9a.diff
LOG: [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
Added:
Modified:
lldb/packages/Python/lldbsuite/test/lldbutil.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index c92626f5baed9..117c624c97dfc 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -755,8 +755,13 @@ def check_breakpoint(
expected_location_resolved - Extected resolved status for the location_id (True/False). Default - True.
expected_location_hit_count - Expected hit count for the breakpoint at location_id. Must be set if the location_id parameter is set.
"""
-
- bkpt = test.target().FindBreakpointByID(bpno)
+
+ if isinstance(test.target, lldb.SBTarget):
+ target = test.target
+ else:
+ target = test.target()
+ bkpt = target.FindBreakpointByID(bpno)
+
test.assertTrue(bkpt.IsValid(), "Breakpoint is not valid.")
if expected_locations is not None:
More information about the lldb-commits
mailing list