diff --git a/gef.py b/gef.py index bc61ad4b4..5c2dbfd24 100644 --- a/gef.py +++ b/gef.py @@ -2021,8 +2021,8 @@ def gdb_get_location_from_symbol(address: int) -> Optional[Tuple[str, int]]: # gdb outputs symbols with format: " + in section of ", # 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 diff --git a/tests/commands/xinfo.py b/tests/commands/xinfo.py index afa53b949..ea50e23b9 100644 --- a/tests/commands/xinfo.py +++ b/tests/commands/xinfo.py @@ -20,8 +20,8 @@ def test_cmd_xinfo(self): self.assertTrue(len(res.splitlines()) >= 7) def test_cmd_xinfo_on_class(self): - cmd = "xinfo $pc" + cmd = "xinfo $pc+4" target = debug_target("class") - res = gdb_run_silent_cmd(cmd, target=target, before=["b B::Run()"]) + res = gdb_run_silent_cmd(cmd, target=target, before=["b *'B::Run'"]) self.assertNoException(res) - self.assertIn("Symbol: B::Run", res) + self.assertIn("Symbol: B::Run()+4", res)