diff options
author | SYNOPSYS\georgiev <georgiev@synopsys.com> | 2021-11-24 11:13:17 +0000 |
---|---|---|
committer | SYNOPSYS\georgiev <georgiev@synopsys.com> | 2021-11-24 11:13:17 +0000 |
commit | c52ff0cfcbf46b81d3df868a259d94910cd15c9a (patch) | |
tree | 441c42d4a04eb290914f93edd18c7a8c7c7b1f87 /lldb/packages/Python/lldbsuite/test/lldbutil.py | |
parent | 976f3b3c9eba0835d5ab7d191bd2e88ceda86ebe (diff) | |
download | llvm-c52ff0cfcbf46b81d3df868a259d94910cd15c9a.zip llvm-c52ff0cfcbf46b81d3df868a259d94910cd15c9a.tar.gz llvm-c52ff0cfcbf46b81d3df868a259d94910cd15c9a.tar.bz2 |
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbutil.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbutil.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py index c92626f..117c624 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: |