Fixed bug when the GDB is debuggin an architecture arm-eabi (disassembly-flavor). (#889)

* Fixed bug when the GDB is debuggin an architecture arm-eabi.

* Removed hidden characters in the code.
pull/866/head
Israel Alberto RV 5 years ago committed by GitHub
parent 4d213a1f90
commit cd0cd8280e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -472,7 +472,14 @@ Unicorn emulation of code near the current instruction
code_lines = pwndbg.config.Parameter('context-code-lines', 10, 'number of additional lines to print in the code context') code_lines = pwndbg.config.Parameter('context-code-lines', 10, 'number of additional lines to print in the code context')
def context_disasm(target=sys.stdout, with_banner=True, width=None): def context_disasm(target=sys.stdout, with_banner=True, width=None):
try:
flavor = gdb.execute('show disassembly-flavor', to_string=True).lower().split('"')[1] flavor = gdb.execute('show disassembly-flavor', to_string=True).lower().split('"')[1]
except gdb.error as e:
if str(e).find("disassembly-flavor") > -1:
flavor = 'intel'
else:
raise
syntax = pwndbg.disasm.CapstoneSyntax[flavor] syntax = pwndbg.disasm.CapstoneSyntax[flavor]
# Get the Capstone object to set disassembly syntax # Get the Capstone object to set disassembly syntax

@ -75,7 +75,13 @@ def get_disassembler_cached(arch, ptrsize, endian, extra=None):
mode |= CapstoneEndian[endian] mode |= CapstoneEndian[endian]
try:
flavor = gdb.execute('show disassembly-flavor', to_string=True).lower().split('"')[1] flavor = gdb.execute('show disassembly-flavor', to_string=True).lower().split('"')[1]
except gdb.error as e:
if str(e).find("disassembly-flavor") > -1:
flavor = 'intel'
else:
raise
cs = Cs(arch, mode) cs = Cs(arch, mode)
cs.syntax = CapstoneSyntax[flavor] cs.syntax = CapstoneSyntax[flavor]

Loading…
Cancel
Save