add aliases to command "vis" and hide autocompletion for replaced commands

2025.04.18
Patryk Sondej 8 months ago
parent 9dd95821b2
commit e2bdba89aa

@ -996,7 +996,7 @@ group.add_argument(
) )
@pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.PTMALLOC2) @pwndbg.commands.ArgparsedCommand(parser, aliases=["vis"], category=CommandCategory.PTMALLOC2)
@pwndbg.commands.OnlyWithResolvedHeapSyms @pwndbg.commands.OnlyWithResolvedHeapSyms
@pwndbg.commands.OnlyWhenHeapIsInitialized @pwndbg.commands.OnlyWhenHeapIsInitialized
@pwndbg.commands.OnlyWhenUserspace @pwndbg.commands.OnlyWhenUserspace

@ -1338,7 +1338,6 @@ class GDB(pwndbg.dbg_mod.Debugger):
# See https://github.com/pwndbg/pwndbg/issues/2890#issuecomment-2813047212 # See https://github.com/pwndbg/pwndbg/issues/2890#issuecomment-2813047212
# Note: Remove this in a late 2025 or 2026 release? # Note: Remove this in a late 2025 or 2026 release?
for deprecated_cmd in ( for deprecated_cmd in (
"dev_dump_instruction",
"vmmap_add", "vmmap_add",
"vmmap_clear", "vmmap_clear",
"vmmap_load", "vmmap_load",
@ -1366,11 +1365,10 @@ class GDB(pwndbg.dbg_mod.Debugger):
"jemalloc_extent_info", "jemalloc_extent_info",
"jemalloc_find_extent", "jemalloc_find_extent",
"jemalloc_heap", "jemalloc_heap",
"reinit_pwndbg",
): ):
fixed_cmd = deprecated_cmd.replace("_", "-") fixed_cmd = deprecated_cmd.replace("_", "-")
gdb.execute( gdb.execute(
f"alias {deprecated_cmd} = echo Use `{fixed_cmd}` instead (Pwndbg changed `_` to `-` in command names)\\n" f"alias -a {deprecated_cmd} = echo Use `{fixed_cmd}` instead (Pwndbg changed `_` to `-` in command names)\\n"
) )
# This may throw an exception, see pwndbg/pwndbg#27 # This may throw an exception, see pwndbg/pwndbg#27

Loading…
Cancel
Save