From b16c8fd5dde9cbfce1b04516d8fb38a26ee64504 Mon Sep 17 00:00:00 2001 From: ValekoZ Date: Sun, 2 Jun 2024 22:53:52 +0200 Subject: [PATCH] Add a test --- gef.py | 2 +- tests/commands/arch.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gef.py b/gef.py index 7a0072d55..d686f184e 100644 --- a/gef.py +++ b/gef.py @@ -4824,7 +4824,7 @@ def do_invoke(self, args: List[str]) -> None: gef_print(Color.greenify("Available architectures:")) for arch in sorted(set(__registered_architectures__.values()), key=lambda x: x.arch): if arch != GenericArchitecture: - gef_print(' ' + Color.yellowify(arch())) + gef_print(' ' + Color.yellowify(str(arch()))) for alias in filter(lambda x: isinstance(x, str), arch.aliases): gef_print(f" {alias}") diff --git a/tests/commands/arch.py b/tests/commands/arch.py index 2d2c9d0e6..8ec2dc40d 100644 --- a/tests/commands/arch.py +++ b/tests/commands/arch.py @@ -30,6 +30,13 @@ def test_cmd_arch_set(self): self.assertIn(" Architecture(X86, 32, LITTLE_ENDIAN)", res) self.assertIn(" The architecture has been set manually", res) + + gdb.execute("arch set ppc") + + res = gdb.execute("arch get", to_string=True) + self.assertIn(" Architecture(PPC, PPC32, LITTLE_ENDIAN)", res) + self.assertIn(" The architecture has been set manually", res) + def test_cmd_arch_list(self): gdb = self._gdb