Skip to content

[lldb][testing] Check all stop reasons in get_threads_stopped_at_breakpoint_id #108281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lldb/packages/Python/lldbsuite/test/lldbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,16 @@ def get_threads_stopped_at_breakpoint_id(process, bpid):
return threads

for thread in stopped_threads:
# Make sure we've hit our breakpoint...
break_id = thread.GetStopReasonDataAtIndex(0)
if break_id == bpid:
# Make sure we've hit our breakpoint.
# From the docs of GetStopReasonDataAtIndex: "Breakpoint stop reasons
# will have data that consists of pairs of breakpoint IDs followed by
# the breakpoint location IDs".
# Iterate over all such pairs looking for `bpid`.
break_ids = [
thread.GetStopReasonDataAtIndex(idx)
for idx in range(0, thread.GetStopReasonDataCount(), 2)
]
if bpid in break_ids:
threads.append(thread)

return threads
Expand Down
Loading