from = ul;
p = pp + 1;
- pp = unpack_varlen_hex (p, &ul);
+ unpack_varlen_hex (p, &ul);
to = ul;
org_to = to;
remote_desc = NULL;
/* We don't have a connection to the remote stub anymore. Get rid
- of all the inferiors and their threads we were controlling. */
- discard_all_inferiors ();
+ of all the inferiors and their threads we were controlling.
+ Reset inferior_ptid to null_ptid first, as otherwise has_stack_frame
+ will be unable to find the thread corresponding to (pid, 0, 0). */
inferior_ptid = null_ptid;
+ discard_all_inferiors ();
/* We're no longer interested in any of these events. */
discard_pending_stop_replies (-1);
/* Send interrupt_sequence to remote target. */
static void
-send_interrupt_sequence ()
+send_interrupt_sequence (void)
{
if (interrupt_sequence_mode == interrupt_sequence_control_c)
serial_write (remote_desc, "\x03", 1);
struct minimal_symbol *sym;
int end;
+ /* The remote side has no concept of inferiors that aren't running
+ yet, it only knows about running processes. If we're connected
+ but our current inferior is not running, we should not invite the
+ remote target to request symbol lookups related to its
+ (unrelated) current process. */
+ if (!target_has_execution)
+ return;
+
if (remote_protocol_packets[PACKET_qSymbol].support == PACKET_DISABLE)
return;
- /* Make sure the remote is pointing at the right process. */
+ /* Make sure the remote is pointing at the right process. Note
+ there's no way to select "no process". */
set_general_process ();
/* Allocate a message buffer. We can't reuse the input buffer in RS,
so we don't have any TID numbers the inferior will
understand. Make sure to only send forms that do not specify
a TID. */
- p = append_resumption (p, endp, minus_one_ptid, step, siggnal);
+ append_resumption (p, endp, minus_one_ptid, step, siggnal);
}
else if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
{
}
/* And continue others without a signal. */
- p = append_resumption (p, endp, ptid, /*step=*/ 0, TARGET_SIGNAL_0);
+ append_resumption (p, endp, ptid, /*step=*/ 0, TARGET_SIGNAL_0);
}
else
{
/* Scheduler locking; resume only PTID. */
- p = append_resumption (p, endp, ptid, step, siggnal);
+ append_resumption (p, endp, ptid, step, siggnal);
}
gdb_assert (strlen (rs->buf) < get_remote_packet_size ());
nptid = ptid;
}
- p = write_ptid (p, endp, nptid);
+ write_ptid (p, endp, nptid);
}
/* In non-stop, we get an immediate OK reply. The stop reply will
case '-':
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "Nak\n");
+ /* FALLTHROUGH */
case SERIAL_TIMEOUT:
tcount++;
if (tcount > 3)