diff options
author | Pedro Alves <pedro@palves.net> | 2022-04-04 21:12:03 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2023-03-10 19:14:18 +0000 |
commit | ba8962fc09f0efbed1eb41cdde752342949a3192 (patch) | |
tree | 6232ac917112a5058805fa2c4a45da40da98a7fe | |
parent | 7a2cd2ddcdaa7fd56e110daac8d47a8694dffcf0 (diff) | |
download | binutils-gdb-ba8962fc09f0efbed1eb41cdde752342949a3192.tar.gz |
all-stop/synchronous RSP support thread-exit events
Currently, GDB does not understand the THREAD_EXITED stop reply in
remote all-stop mode. There's no good reason for this, it just
happened that THREAD_EXITED was only ever reported in non-stop mode so
far. This patch teaches GDB to parse that event in all-stop RSP too.
There is no need to add a qSupported feature for this, because the
server won't send a THREAD_EXITED event unless GDB explicitly asks for
it, with QThreadEvents, or with the GDB_THREAD_OPTION_EXIT
QThreadOptions option added in the next patch.
Change-Id: Ide5d12391adf432779fe4c79526801c4a5630966
-rw-r--r-- | gdb/remote.c | 5 | ||||
-rw-r--r-- | gdbserver/server.cc | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 62f25b03928..a59566505cd 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8354,7 +8354,8 @@ remote_target::process_stop_reply (struct stop_reply *stop_reply, && status->kind () != TARGET_WAITKIND_NO_RESUMED) { /* Expedited registers. */ - if (!stop_reply->regcache.empty ()) + if (status->kind () != TARGET_WAITKIND_THREAD_EXITED + && !stop_reply->regcache.empty ()) { struct regcache *regcache = get_thread_arch_regcache (this, ptid, stop_reply->arch); @@ -8540,7 +8541,7 @@ remote_target::wait_as (ptid_t ptid, target_waitstatus *status, again. Keep waiting for events. */ rs->waiting_for_stop_reply = 1; break; - case 'N': case 'T': case 'S': case 'X': case 'W': + case 'N': case 'T': case 'S': case 'X': case 'W': case 'w': { /* There is a stop reply to handle. */ rs->waiting_for_stop_reply = 0; diff --git a/gdbserver/server.cc b/gdbserver/server.cc index a2e4fa68db3..a573f5b0f65 100644 --- a/gdbserver/server.cc +++ b/gdbserver/server.cc @@ -3045,6 +3045,7 @@ resume (struct thread_resume *actions, size_t num_actions) if (cs.last_status.kind () != TARGET_WAITKIND_EXITED && cs.last_status.kind () != TARGET_WAITKIND_SIGNALLED + && cs.last_status.kind () != TARGET_WAITKIND_THREAD_EXITED && cs.last_status.kind () != TARGET_WAITKIND_NO_RESUMED) current_thread->last_status = cs.last_status; |