aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:44:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:44:35 +0000
commit901f991244d02f62d4e7a9c903de9f05175de2ac (patch)
tree08d7054d217d985dd403d6d1ada870752250d35f /gdb
parente714e1bf77429248e080fee199c87376a8649184 (diff)
downloadgdb-901f991244d02f62d4e7a9c903de9f05175de2ac.zip
gdb-901f991244d02f62d4e7a9c903de9f05175de2ac.tar.gz
gdb-901f991244d02f62d4e7a9c903de9f05175de2ac.tar.bz2
2012-01-20 Pedro Alves <palves@redhat.com>
Ulrich Weigand <ulrich.weigand@linaro.org> ChangeLog: * remote.c (remote_multi_process_p): Only check for multi-process protocol feature, do not check for extended protocol. (remote_supports_multi_process): Check for extended protocol here. (set_general_process): Likewise. (extended_remote_kill): Likewise. (remote_pid_to_str): Likewise. (remote_query_supported): Always query multiprocess mode. gdbserver/ChangeLog: * server.c (handle_v_requests): Only support vAttach and vRun to start multiple processes when in extended protocol mode.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/server.c4
-rw-r--r--gdb/remote.c17
4 files changed, 29 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 975fd75..6a94f5d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,17 @@
2012-01-20 Pedro Alves <palves@redhat.com>
Ulrich Weigand <ulrich.weigand@linaro.org>
+ * remote.c (remote_multi_process_p): Only check for multi-process
+ protocol feature, do not check for extended protocol.
+ (remote_supports_multi_process): Check for extended protocol here.
+ (set_general_process): Likewise.
+ (extended_remote_kill): Likewise.
+ (remote_pid_to_str): Likewise.
+ (remote_query_supported): Always query multiprocess mode.
+
+2012-01-20 Pedro Alves <palves@redhat.com>
+ Ulrich Weigand <ulrich.weigand@linaro.org>
+
* inferior.h (struct inferior): Add fake_pid_p.
* inferior.c (exit_inferior_1): Clear fake_pid_p.
* remote.c (remote_start_remote): Set fake_pid_p if we have to use
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 901a990..72f0286 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-20 Pedro Alves <palves@redhat.com>
+ Ulrich Weigand <ulrich.weigand@linaro.org>
+
+ * server.c (handle_v_requests): Only support vAttach and vRun to
+ start multiple processes when in extended protocol mode.
+
2012-01-17 Pedro Alves <palves@redhat.com>
* tracepoint.c (initialize_tracepoint): Use mmap instead of
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index bebccf5..3080a0c 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2144,7 +2144,7 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
if (strncmp (own_buf, "vAttach;", 8) == 0)
{
- if (!multi_process && target_running ())
+ if ((!extended_protocol || !multi_process) && target_running ())
{
fprintf (stderr, "Already debugging a process\n");
write_enn (own_buf);
@@ -2156,7 +2156,7 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
if (strncmp (own_buf, "vRun;", 5) == 0)
{
- if (!multi_process && target_running ())
+ if ((!extended_protocol || !multi_process) && target_running ())
{
fprintf (stderr, "Already debugging a process\n");
write_enn (own_buf);
diff --git a/gdb/remote.c b/gdb/remote.c
index 3a9e2f6..2b46c43 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -359,7 +359,7 @@ free_private_thread_info (struct private_thread_info *info)
static int
remote_multi_process_p (struct remote_state *rs)
{
- return rs->extended && rs->multi_process_aware;
+ return rs->multi_process_aware;
}
/* This data could be associated with a target, but we do not always
@@ -1713,7 +1713,7 @@ 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))
+ if (!rs->extended || !remote_multi_process_p (rs))
return;
/* We only need to change the remote current thread if it's pointing
@@ -3885,8 +3885,7 @@ remote_query_supported (void)
char *q = NULL;
struct cleanup *old_chain = make_cleanup (free_current_contents, &q);
- if (rs->extended)
- q = remote_query_supported_append (q, "multiprocess+");
+ q = remote_query_supported_append (q, "multiprocess+");
if (remote_support_xml)
q = remote_query_supported_append (q, remote_support_xml);
@@ -7440,7 +7439,7 @@ extended_remote_kill (struct target_ops *ops)
struct remote_state *rs = get_remote_state ();
res = remote_vkill (pid, rs);
- if (res == -1 && !remote_multi_process_p (rs))
+ if (res == -1 && !(rs->extended && remote_multi_process_p (rs)))
{
/* Don't try 'k' on a multi-process aware stub -- it has no way
to specify the pid. */
@@ -8832,7 +8831,7 @@ remote_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
if (ptid_equal (magic_null_ptid, ptid))
xsnprintf (buf, sizeof buf, "Thread <main>");
- else if (remote_multi_process_p (rs))
+ else if (rs->extended && remote_multi_process_p (rs))
xsnprintf (buf, sizeof buf, "Thread %d.%ld",
ptid_get_pid (ptid), ptid_get_tid (ptid));
else
@@ -9773,7 +9772,11 @@ remote_supports_multi_process (void)
{
struct remote_state *rs = get_remote_state ();
- return remote_multi_process_p (rs);
+ /* Only extended-remote handles being attached to multiple
+ processes, even though plain remote can use the multi-process
+ thread id extensions, so that GDB knows the target process's
+ PID. */
+ return rs->extended && remote_multi_process_p (rs);
}
int