diff --git a/pwndbg/commands/__init__.py b/pwndbg/commands/__init__.py index 6bc172a33..9525a9531 100644 --- a/pwndbg/commands/__init__.py +++ b/pwndbg/commands/__init__.py @@ -265,6 +265,11 @@ def OnlyWhenQemuKernel(function): def OnlyWithArch(arch_names: List[str]): """Decorates function to work only with the specified archictectures.""" + for arch in arch_names: + if arch not in pwndbg.gdblib.arch_mod.ARCHS: + raise ValueError( + f"OnlyWithArch used with unsupported arch={arch}. Must be one of {', '.join(arch_names)}" + ) def decorator(function): @functools.wraps(function) diff --git a/pwndbg/commands/cymbol.py b/pwndbg/commands/cymbol.py index 9075c7e38..16fe84978 100755 --- a/pwndbg/commands/cymbol.py +++ b/pwndbg/commands/cymbol.py @@ -249,7 +249,7 @@ parser.add_argument( @pwndbg.commands.ArgparsedCommand(parser) -@pwndbg.commands.OnlyWithArch(["x86_64"]) +@pwndbg.commands.OnlyWithArch(["x86-64"]) @pwndbg.commands.OnlyWhenRunning def cymbol(add, remove, edit, load, show) -> None: if add: diff --git a/pwndbg/gdblib/arch.py b/pwndbg/gdblib/arch.py index c89a6ae28..bca10f4fc 100644 --- a/pwndbg/gdblib/arch.py +++ b/pwndbg/gdblib/arch.py @@ -7,7 +7,7 @@ from pwndbg.lib.arch import Arch # TODO: x86-64 needs to come before i386 in the current implementation, make # this order-independent -ARCHS = ("x86-64", "i386", "aarch64", "mips", "powerpc", "sparc", "arm") +ARCHS = ("x86-64", "i386", "aarch64", "mips", "powerpc", "sparc", "arm", "armcm") # mapping between gdb and pwntools arch names pwnlib_archs_mapping = {