GP-4757: fix for 'info registers'

This commit is contained in:
d-millar 2024-07-29 09:12:30 -04:00 committed by Dan
parent c175cfa23c
commit e520bcdcfd
2 changed files with 7 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import gdb
language_map = {
'aarch64': ['AARCH64:BE:64:v8A', 'AARCH64:LE:64:AppleSilicon', 'AARCH64:LE:64:v8A'],
'aarch64:ilp32': ['AARCH64:BE:32:ilp32', 'AARCH64:LE:32:ilp32', 'AARCH64:LE:64:AppleSilicon'],
'arm': ['ARM:BE:32:v8', 'ARM:BE:32:v8T', 'ARM:LE:32:v8', 'ARM:LE:32:v8T'],
'arm_any': ['ARM:BE:32:v8', 'ARM:BE:32:v8T', 'ARM:LE:32:v8', 'ARM:LE:32:v8T'],
'armv2': ['ARM:BE:32:v4', 'ARM:LE:32:v4'],
'armv2a': ['ARM:BE:32:v4', 'ARM:LE:32:v4'],

View File

@ -422,8 +422,12 @@ def get_register_descs(arch, group='all'):
return arch.registers()
else:
descs = []
regset = gdb.execute(
f"info registers {group}", to_string=True).strip().split('\n')
try:
regset = gdb.execute(
f"info registers {group}", to_string=True).strip().split('\n')
except Exception as e:
regset = gdb.execute(
f"info registers", to_string=True).strip().split('\n')
for line in regset:
if not line.startswith(" "):
tokens = line.strip().split()