static void remote_find_new_threads (void);
-static void record_currthread (ptid_t currthread);
-
static int fromhex (int a);
static int putpkt_binary (char *buf, int cnt);
remote_open knows that we don't have a file open when the program
starts. */
struct serial *remote_desc;
+
+ /* These are the threads which we last sent to the remote system. The
+ TID member will be -1 for all or -2 for not sent yet. */
+ ptid_t general_thread;
+ ptid_t continue_thread;
};
/* Private data that we'll store in (struct thread_info)->private. */
static ptid_t not_sent_ptid;
static ptid_t any_thread_ptid;
-/* These are the threads which we last sent to the remote system. The
- TID member will be -1 for all or -2 for not sent yet. */
-
-static ptid_t general_thread;
-static ptid_t continue_thread;
-
/* This is the traceframe which we last selected on the remote system.
It will be -1 if no traceframe is selected. */
static int remote_traceframe_number = -1;
3) Successful execution of set thread */
static void
-record_currthread (ptid_t currthread)
+record_currthread (struct remote_state *rs, ptid_t currthread)
{
- general_thread = currthread;
+ rs->general_thread = currthread;
}
static char *last_pass_packet;
set_thread (struct ptid ptid, int gen)
{
struct remote_state *rs = get_remote_state ();
- ptid_t state = gen ? general_thread : continue_thread;
+ ptid_t state = gen ? rs->general_thread : rs->continue_thread;
char *buf = rs->buf;
char *endbuf = rs->buf + get_remote_packet_size ();
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
if (gen)
- general_thread = ptid;
+ rs->general_thread = ptid;
else
- continue_thread = ptid;
+ rs->continue_thread = ptid;
}
static void
/* We only need to change the remote current thread if it's pointing
at some other process. */
- if (ptid_get_pid (general_thread) != ptid_get_pid (inferior_ptid))
+ if (ptid_get_pid (rs->general_thread) != ptid_get_pid (inferior_ptid))
set_general_thread (inferior_ptid);
}
rs->waiting_for_stop_reply = 0;
rs->ctrlc_pending_p = 0;
- general_thread = not_sent_ptid;
- continue_thread = not_sent_ptid;
+ rs->general_thread = not_sent_ptid;
+ rs->continue_thread = not_sent_ptid;
remote_traceframe_number = -1;
/* Probe for ability to use "ThreadInfo" query, as required. */
inferior_ptid = pid_to_ptid (pid);
/* Invalidate our notion of the remote current thread. */
- record_currthread (minus_one_ptid);
+ record_currthread (rs, minus_one_ptid);
}
else
{
&& status->kind != TARGET_WAITKIND_SIGNALLED)
{
if (!ptid_equal (event_ptid, null_ptid))
- record_currthread (event_ptid);
+ record_currthread (rs, event_ptid);
else
event_ptid = inferior_ptid;
}
else
/* A process exit. Invalidate our notion of current thread. */
- record_currthread (minus_one_ptid);
+ record_currthread (rs, minus_one_ptid);
return event_ptid;
}
To keep things simple, we always invalidate our notion of the
current thread. */
- record_currthread (minus_one_ptid);
+ record_currthread (rs, minus_one_ptid);
/* Unlike "target remote", we do not want to unpush the target; then
the next time the user says "run", we won't be connected. */