Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate arguments passed to vmmap #1085

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/commands/vmmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ determine which section it belongs to.
![vmmap-grep](https://i.imgur.com/ZFF4QVf.png)

![vmmap-address](https://i.imgur.com/hfcs1jH.png)

The address can be also be given in the form of a register or variable.

![vmmap-register](https://i.imgur.com/RlZA6NU.png)
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)
Loading