nxgdb/thread: fix ps command

Fix ps command reports wrong running stack corruption.
To get running tcb registers, need to read from frame register not the tcb context.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-11-29 09:27:47 +08:00 committed by Xiang Xiao
parent 1d55f111f3
commit 08139fb1db

View file

@ -514,7 +514,7 @@ class Ps(gdb.Command):
int(tcb["stack_base_ptr"]),
int(tcb["stack_alloc_ptr"]),
int(tcb["adj_stack_size"]),
utils.get_sp(tcb),
utils.get_sp(tcb if tcb["task_state"] != TSTATE_TASK_RUNNING else None),
4,
)