Skip to content

Commit

Permalink
Fix context regs regression that broke reg order
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Aug 16, 2023
1 parent d27efd3 commit 3085b31
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -6772,11 +6772,9 @@ def do_invoke(self, _: List[str], **kwargs: Any) -> None:

args : argparse.Namespace = kwargs["arguments"]
if args.registers and args.registers[0]:
requested_regs = set(args.registers)
valid_regs = set(gef.arch.all_registers) & requested_regs
if valid_regs:
regs = valid_regs
invalid_regs = requested_regs - valid_regs
all_regs = set(gef.arch.all_registers)
regs = [reg for reg in args.registers if reg in all_regs]
invalid_regs = [reg for reg in args.registers if reg not in all_regs]
if invalid_regs:
err(f"invalid registers for architecture: {', '.join(invalid_regs)}")

Expand Down Expand Up @@ -7357,8 +7355,8 @@ def context_regs(self) -> None:
ignored_registers = set(self["ignore_registers"].split())

if self["show_registers_raw"] is False:
regs = set(gef.arch.all_registers)
printable_registers = " ".join(regs - ignored_registers)
regs = [reg for reg in gef.arch.all_registers if reg not in ignored_registers]
printable_registers = " ".join(regs)
gdb.execute(f"registers {printable_registers}")
return

Expand Down

0 comments on commit 3085b31

Please sign in to comment.