From 08139fb1db3e3d6a2694e12976c77eaa8d260dc2 Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Fri, 29 Nov 2024 09:27:47 +0800 Subject: [PATCH] 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 --- tools/gdb/nuttxgdb/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gdb/nuttxgdb/thread.py b/tools/gdb/nuttxgdb/thread.py index 5c8559d873..ef08489bf1 100644 --- a/tools/gdb/nuttxgdb/thread.py +++ b/tools/gdb/nuttxgdb/thread.py @@ -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, )