This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] extended-remote and attach_flag
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 21 Feb 2008 17:33:35 +0000
- Subject: [commit] extended-remote and attach_flag
Hi,
As a nice team work, Sandra noticed that on extended-remote, gdb
would kill the inferior when quitting, even when we were
attached. Daniel pointed at the cause, and I got the hard
job of implementing the fix.
The problem was that remote.c wasn't setting the attach_flag.
I now get:
(gdb) quit
The program is running. Quit anyway (and detach it)? (y or n) y
Detached from remote process.
Tested manually and by running the testsuite on a native gdbserver
on x86_64-unknown-linux-gnu.
Daniel approved this offlist, so I committed it. It's obvious
anyway.
--
Pedro Alves
2008-02-21 Pedro Alves <pedro@codesourcery.com>
* remote.c (extended_remote_attach_1): Set attach_flag.
(extended_remote_create_inferior_1): Clear attach_flag.
---
gdb/remote.c | 2 ++
1 file changed, 2 insertions(+)
Index: src/gdb/remote.c
===================================================================
--- src.orig/gdb/remote.c 2008-02-21 15:27:03.000000000 +0000
+++ src/gdb/remote.c 2008-02-21 16:52:33.000000000 +0000
@@ -2874,6 +2874,7 @@ extended_remote_attach_1 (struct target_
target_mark_running (target);
inferior_ptid = pid_to_ptid (pid);
+ attach_flag = 1;
}
static void
@@ -5482,6 +5483,7 @@ extended_remote_create_inferior_1 (char
}
/* Now mark the inferior as running before we do anything else. */
+ attach_flag = 0;
inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
if (async_p)
target_mark_running (&extended_async_remote_ops);