Fixed output message when unmatched mapping was encountered in the `base` function. (#3158)

* Fixed traceback in () on unmatched mappings

* Show cleaner output for () no mapping found error

* fix docs
pull/3163/head
AG 5 months ago committed by GitHub
parent f7f8b31f4f
commit b27b5bf2c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -91,7 +91,7 @@ pwndbg> argv
``` {.python .no-copy}
base(name_pattern: gdb.Value | str) -> int
base(name_pattern: gdb.Value | str)
```

@ -96,7 +96,7 @@ def rebase(addr: gdb.Value | int) -> int:
@GdbFunction(only_when_running=True)
def base(name_pattern: gdb.Value | str) -> int:
def base(name_pattern: gdb.Value | str):
"""
Return the base address of the first memory mapping containing the given name.
@ -132,7 +132,8 @@ def base(name_pattern: gdb.Value | str) -> int:
for p in pwndbg.aglib.vmmap.get():
if name in p.objfile:
return p.vaddr
raise ValueError(f"No mapping named {name}")
raise gdb.GdbError(f"$base error: No mapping named '{name}'")
@GdbFunction()

Loading…
Cancel
Save