Skip to content

Commit

Permalink
correct parsing in gdb_get_location_from_symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelo942 committed Jan 3, 2024
1 parent d4b849e commit bb8ef61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2021,8 +2021,8 @@ def gdb_get_location_from_symbol(address: int) -> Optional[Tuple[str, int]]:
# 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].strip(), 0
sym = sym[:i].split(" + ")
name, offset = sym[0], 0
if len(sym) == 2 and sym[1].isdigit():
offset = int(sym[1])
return name, offset
Expand Down

0 comments on commit bb8ef61

Please sign in to comment.