Skip to content

Commit

Permalink
Evaluate arguments passed to vmmap
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Apr 18, 2024
1 parent d211658 commit bb47c27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions tests/commands/vmmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit bb47c27

Please sign in to comment.