diff --git a/tools/gdbserver.py b/tools/gdbserver.py index fcb63a8069..57f5b52337 100755 --- a/tools/gdbserver.py +++ b/tools/gdbserver.py @@ -117,6 +117,41 @@ reg_table = { "PC": 15, "CPSR": 41, }, + "arm64": { + "X0": 0, + "X1": 1, + "X2": 2, + "X3": 3, + "X4": 4, + "X5": 5, + "X6": 6, + "X7": 7, + "X8": 8, + "X9": 9, + "X10": 10, + "X11": 11, + "X12": 12, + "X13": 13, + "X14": 14, + "X15": 15, + "X16": 16, + "X17": 17, + "X18": 18, + "X19": 19, + "X20": 20, + "X21": 21, + "X22": 22, + "X23": 23, + "X24": 24, + "X25": 25, + "X26": 26, + "X27": 27, + "X28": 28, + "X29": 29, + "X30": 30, + "SP_ELX": 31, + "ELR": 32, + }, # rv64 works with gdb-multiarch on Ubuntu "riscv": { "ZERO": 0, @@ -375,9 +410,10 @@ class DumpLogFile: line = line.strip() # find register value - find_res = re.findall(r"(?P\w+): (?P[0-9a-fA-F]+)", line) + find_res = re.findall(r"(?P\w+):\s*(?P[0-9a-fxA-FX]+)", line) for reg_name, reg_val in find_res: + reg_name = reg_name.upper() if reg_name in self.reg_table: reg_index = self.reg_table[reg_name] self.registers[reg_index] = int(reg_val, 16) @@ -526,6 +562,7 @@ class GDBStub: self.gdb_signal = GDB_SIGNAL_DEFAULT self.arch = arch self.reg_fmt = "