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
/* Expedited registers. */
if (!stop_reply->regcache.empty ())
{
/* Expedited registers. */
if (!stop_reply->regcache.empty ())
{
+ /* 'w' stop replies don't cary expedited registers (which
+ wouldn't make any sense for a thread that is gone
+ already). */
+ gdb_assert (status->kind () != TARGET_WAITKIND_THREAD_EXITED);
+
struct regcache *regcache
= get_thread_arch_regcache (this, ptid, stop_reply->arch);
struct regcache *regcache
= get_thread_arch_regcache (this, ptid, stop_reply->arch);
again. Keep waiting for events. */
rs->waiting_for_stop_reply = 1;
break;
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;
{
/* There is a stop reply to handle. */
rs->waiting_for_stop_reply = 0;
if (cs.last_status.kind () != TARGET_WAITKIND_EXITED
&& cs.last_status.kind () != TARGET_WAITKIND_SIGNALLED
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;
&& cs.last_status.kind () != TARGET_WAITKIND_NO_RESUMED)
current_thread->last_status = cs.last_status;