From e2bdba89aaa6fd47be7ef1675ce982714cb32b7f Mon Sep 17 00:00:00 2001 From: Patryk Sondej Date: Fri, 18 Apr 2025 02:18:43 +0200 Subject: [PATCH] add aliases to command "vis" and hide autocompletion for replaced commands --- pwndbg/commands/ptmalloc2.py | 2 +- pwndbg/dbg/gdb/__init__.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pwndbg/commands/ptmalloc2.py b/pwndbg/commands/ptmalloc2.py index 7deb69d14..f1291bf3b 100644 --- a/pwndbg/commands/ptmalloc2.py +++ b/pwndbg/commands/ptmalloc2.py @@ -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.OnlyWhenHeapIsInitialized @pwndbg.commands.OnlyWhenUserspace diff --git a/pwndbg/dbg/gdb/__init__.py b/pwndbg/dbg/gdb/__init__.py index c70fbab4a..e021f312e 100644 --- a/pwndbg/dbg/gdb/__init__.py +++ b/pwndbg/dbg/gdb/__init__.py @@ -1338,7 +1338,6 @@ class GDB(pwndbg.dbg_mod.Debugger): # See https://github.com/pwndbg/pwndbg/issues/2890#issuecomment-2813047212 # Note: Remove this in a late 2025 or 2026 release? for deprecated_cmd in ( - "dev_dump_instruction", "vmmap_add", "vmmap_clear", "vmmap_load", @@ -1366,11 +1365,10 @@ class GDB(pwndbg.dbg_mod.Debugger): "jemalloc_extent_info", "jemalloc_find_extent", "jemalloc_heap", - "reinit_pwndbg", ): fixed_cmd = deprecated_cmd.replace("_", "-") 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