+2020-01-10 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+ Pedro Alves <palves@redhat.com>
+
+ * remote.c (remote_target::remote_parse_stop_reply) <W/X packets>:
+ If no process is specified, return null_ptid instead of
+ inferior_ptid.
+ (remote_target::wait_as): Handle TARGET_WAITKIND_EXITED /
+ TARGET_WAITKIND_SIGNALLED with no pid.
+
2020-01-10 Pedro Alves <palves@redhat.com>
* remote.c (first_remote_resumed_thread): New.
case 'W': /* Target exited. */
case 'X':
{
- int pid;
ULONGEST value;
/* GDB used to accept only 2 hex chars here. Stubs should
event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
}
- /* If no process is specified, assume inferior_ptid. */
- pid = inferior_ptid.pid ();
+ /* If no process is specified, return null_ptid, and let the
+ caller figure out the right process to use. */
+ int pid = 0;
if (*p == '\0')
;
else if (*p == ';')
event_ptid = first_remote_resumed_thread ();
}
else
- /* A process exit. Invalidate our notion of current thread. */
- record_currthread (rs, minus_one_ptid);
+ {
+ /* A process exit. Invalidate our notion of current thread. */
+ record_currthread (rs, minus_one_ptid);
+ /* It's possible that the packet did not include a pid. */
+ if (event_ptid == null_ptid)
+ event_ptid = first_remote_resumed_thread ();
+ /* EVENT_PTID could still be NULL_PTID. Double-check. */
+ if (event_ptid == null_ptid)
+ event_ptid = magic_null_ptid;
+ }
return event_ptid;
}
+2020-01-10 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+ Pedro Alves <palves@redhat.com>
+
+ * gdb.server/connect-without-multi-process.exp: Also test
+ continuing to end.
+
2020-01-10 Pedro Alves <palves@redhat.com>
* gdb.base/remote-exec-file.exp: New file.
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
# Check that we can connect to GDBserver with the multiprocess
-# extensions disabled, and run to main.
+# extensions disabled, run to main, and finish the process.
load_lib gdbserver-support.exp
"target $gdbserver_protocol"
gdb_test "continue" "main .*" "continue to main"
+
+ # The W/X packets do not include the PID of the exiting process
+ # without the multi-process extensions. Check that we handle
+ # process exit correctly in that case.
+ gdb_continue_to_end
}
foreach multiprocess { "off" "auto" } {