Skip to content

Commit

Permalink
address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f committed Dec 21, 2023
1 parent 97940e7 commit 94fd47d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2010,9 +2010,11 @@ def gdb_get_location_from_symbol(address: int) -> Optional[Tuple[str, int]]:
if sym.startswith("No symbol matches"):
return None

# gdb outputs symbols with format: "<symbol_name> + <offset> in section <section_name> of <file>",
# here, we are only interested in symbol name and offset.
i = sym.find(" in section ")
sym = sym[:i].split('+')
name, offset = sym[0], 0
sym = sym[:i].split("+")
name, offset = sym[0].strip(), 0
if len(sym) == 2 and sym[1].isdigit():
offset = int(sym[1])
return name, offset
Expand Down

0 comments on commit 94fd47d

Please sign in to comment.