Skip to content

Commit a2aff4e

Browse files
committed
bt_has_any: remove redundant code
Signed-off-by: Stephen Brennan <[email protected]>
1 parent e08bc32 commit a2aff4e

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

drgn_tools/bt.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -571,21 +571,9 @@ def bt_has_any(
571571
return _indexed_bt_has_any(prog, funcs)
572572

573573
frame_list = []
574-
if task is not None:
575-
try:
576-
frames = bt_frames(task)
577-
for frame in frames:
578-
if func_name(prog, frame) in funcs:
579-
frame_list.append((task, frame))
580-
581-
return frame_list
574+
tasks = [task] if task is not None else for_each_task(prog)
582575

583-
except (FaultError, ValueError):
584-
# FaultError: catch unusual unwinding issues
585-
# ValueError: catch "cannot unwind stack of running task"
586-
pass
587-
588-
for task in for_each_task(prog):
576+
for task in tasks:
589577
try:
590578
frames = bt_frames(task)
591579
for frame in frames:

0 commit comments

Comments
 (0)