diff --git a/gef.py b/gef.py index ec03cbe99..f99cf2841 100644 --- a/gef.py +++ b/gef.py @@ -8711,6 +8711,10 @@ def do_invoke(self, argv: List[str]) -> None: addr = int(argv[0], 0) if addr >= entry.page_start and addr < entry.page_end: self.print_entry(entry) + else: + addr = safe_parse_and_eval(argv[0]) + if addr is not None and addr >= entry.page_start and addr < entry.page_end: + self.print_entry(entry) return def print_entry(self, entry: Section) -> None: diff --git a/tests/commands/vmmap.py b/tests/commands/vmmap.py index 50dfeacaa..591d3b387 100644 --- a/tests/commands/vmmap.py +++ b/tests/commands/vmmap.py @@ -21,3 +21,6 @@ def test_cmd_vmmap(self): res = gdb.execute("vmmap stack", to_string=True) self.assertGreater(len(res.splitlines()), 1) + + res = gdb.execute("vmmap $rip", to_string=True) + self.assertEqual(len(res.splitlines()), 2)