Skip to content

Commit

Permalink
add thread symbol resolving like traces (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahaloz committed Oct 14, 2021
1 parent 48ed480 commit 5c2fe28
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gef.py
Expand Up @@ -8901,7 +8901,16 @@ def reason():
line += Color.colorify("stopped", "bold red")
thread.switch()
frame = gdb.selected_frame()
line += " {:s} in {:s} ()".format(Color.colorify("{:#x}".format(frame.pc()), "blue"), Color.colorify(frame.name() or "??", "bold yellow"))
frame_name = frame.name()

# check if the gdb symbol table may know the address
if not frame_name:
sym_found = gdb_get_location_from_symbol(frame.pc())
if sym_found:
sym_name, offset = sym_found
frame_name = "<{}+{:x}>".format(sym_name, offset)

line += " {:s} in {:s} ()".format(Color.colorify("{:#x}".format(frame.pc()), "blue"), Color.colorify(frame_name or "??", "bold yellow"))
line += ", reason: {}".format(Color.colorify(reason(), "bold pink"))
elif thread.is_exited():
line += Color.colorify("exited", "bold yellow")
Expand Down

0 comments on commit 5c2fe28

Please sign in to comment.