This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 5f36b60368767561e62a93f876070a7ece64404d Author: xuxingliang <[email protected]> AuthorDate: Fri Feb 7 20:52:52 2025 +0800 gdbstub: should update register cache whenever CPU stops With the register cache, the registers of a thread are loaded when GDB selects the thread. When the target stops again, GDB reads the registers of the stopped thread without selecting it again if it is already the selected one, and the cache still holds the registers from before the target was resumed. Select the running thread and reload the cache before reporting the stop. Signed-off-by: xuxingliang <[email protected]> --- libs/libc/gdbstub/lib_gdbstub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/libc/gdbstub/lib_gdbstub.c b/libs/libc/gdbstub/lib_gdbstub.c index fff985318cc..b6aed62b89f 100644 --- a/libs/libc/gdbstub/lib_gdbstub.c +++ b/libs/libc/gdbstub/lib_gdbstub.c @@ -2128,6 +2128,8 @@ int gdb_process(FAR struct gdb_state_s *state, int stopreason, if (stopreason != GDB_STOPREASON_NONE) { + state->pid = _SCHED_GETTID(); + gdb_update_regcache(state); gdb_send_stop(state, stopreason, stopaddr); }
