mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
thread.py: fix bug that ARM-A TCB info register offset is discontinuous
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
+12
-7
@@ -113,18 +113,23 @@ class SetRegs(gdb.Command):
|
|||||||
tcbinfo = gdb.parse_and_eval("g_tcbinfo")
|
tcbinfo = gdb.parse_and_eval("g_tcbinfo")
|
||||||
save_regs()
|
save_regs()
|
||||||
arch = gdb.selected_frame().architecture()
|
arch = gdb.selected_frame().architecture()
|
||||||
|
|
||||||
|
regoffset = [
|
||||||
|
int(tcbinfo["reg_off"]["p"][i])
|
||||||
|
for i in range(tcbinfo["regs_num"])
|
||||||
|
if tcbinfo["reg_off"]["p"][i] != UINT16_MAX
|
||||||
|
]
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
for reg in arch.registers():
|
for reg in arch.registers():
|
||||||
if i >= tcbinfo["regs_num"]:
|
if i >= len(regoffset):
|
||||||
return
|
return
|
||||||
|
|
||||||
gdb.execute("select-frame 0")
|
gdb.execute("select-frame 0")
|
||||||
if tcbinfo["reg_off"]["p"][i] != UINT16_MAX:
|
value = gdb.Value(regs + regoffset[i]).cast(
|
||||||
value = gdb.Value(regs + tcbinfo["reg_off"]["p"][i]).cast(
|
utils.lookup_type("uintptr_t").pointer()
|
||||||
utils.lookup_type("uintptr_t").pointer()
|
)[0]
|
||||||
)[0]
|
gdb.execute(f"set ${reg.name} = {value}")
|
||||||
gdb.execute(f"set ${reg.name} = {value}")
|
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user