Skip to content

Commit

Permalink
Resolve Context Trace Symbols (#743)
Browse files Browse the repository at this point in the history
* add symbol resolving for traces
  • Loading branch information
mahaloz committed Oct 14, 2021
1 parent 8719457 commit 48ed480
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gef.py
Expand Up @@ -8832,7 +8832,15 @@ def context_trace(self):
insn = next(gef_disassemble(pc, 1))
except gdb.MemoryError:
break
items.append(Color.redify("{} {}".format(insn.mnemonic, ", ".join(insn.operands))))

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

items.append(Color.redify("{}{} {}".format(symbol, insn.mnemonic, ", ".join(insn.operands))))

gef_print("[{}] {}".format(Color.colorify("#{}".format(level), "bold green" if current_frame == orig_frame else "bold pink"),
RIGHT_ARROW.join(items)))
Expand Down

0 comments on commit 48ed480

Please sign in to comment.