aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-10-16 14:39:54 +0000
committerPedro Alves <palves@redhat.com>2008-10-16 14:39:54 +0000
commit3c9c4b83df84dc1fb2c8b4d7024049d5e0f53249 (patch)
treeda1698dd00edf282e604e7e849fc370e4e21dd70 /gdb/remote.c
parent5c952c9bcba64067d4108613aecab69f432677c0 (diff)
downloadgdb-3c9c4b83df84dc1fb2c8b4d7024049d5e0f53249.zip
gdb-3c9c4b83df84dc1fb2c8b4d7024049d5e0f53249.tar.gz
gdb-3c9c4b83df84dc1fb2c8b4d7024049d5e0f53249.tar.bz2
* remote.c (set_general_process): New.
(remote_check_symbols): Use it.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 9a473f2..f9249f6 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1246,6 +1246,30 @@ set_continue_thread (struct ptid ptid)
set_thread (ptid, 0);
}
+/* Change the remote current process. Which thread within the process
+ ends up selected isn't important, as long as it is the same process
+ as what INFERIOR_PTID points to.
+
+ This comes from that fact that there is no explicit notion of
+ "selected process" in the protocol. The selected process for
+ general operations is the process the selected general thread
+ belongs to. */
+
+static void
+set_general_process (void)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ /* If the remote can't handle multiple processes, don't bother. */
+ if (!remote_multi_process_p (rs))
+ return;
+
+ /* 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))
+ set_general_thread (inferior_ptid);
+}
+
/* Return nonzero if the thread PTID is still alive on the remote
system. */
@@ -2553,6 +2577,9 @@ remote_check_symbols (struct objfile *objfile)
if (remote_protocol_packets[PACKET_qSymbol].support == PACKET_DISABLE)
return;
+ /* Make sure the remote is pointing at the right process. */
+ set_general_process ();
+
/* Allocate a message buffer. We can't reuse the input buffer in RS,
because we need both at the same time. */
msg = alloca (get_remote_packet_size ());