tools/gdb: always use name to read register

For unknown reason, for some cases, GDB refuses to read register using descriptor. Let's stick to the register name.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-09-18 13:37:59 +08:00 committed by Xiang Xiao
parent 9881fbae28
commit a0e9b82a79

View file

@ -94,9 +94,6 @@ class Registers:
reginfo[name] = {
"rmt_nr": rmt_nr, # The register number in remote-registers, Aka the one we saved in g_tcbinfo.
"tcb_reg_off": tcb_reg_off,
"desc": registers.find(
name
), # Register descriptor. It's faster for frame.read_register
}
Registers.reginfo = reginfo
@ -142,8 +139,8 @@ class Registers:
registers = {}
frame = gdb.newest_frame()
for name, info in Registers.reginfo.items():
value = frame.read_register(info["desc"])
for name, _ in Registers.reginfo.items():
value = frame.read_register(name)
registers[name] = value
Registers.saved_regs = registers