aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/run-after-attach.c
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-07-29 20:03:43 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-08-26 20:50:43 -0400
commite9756d52bea3834ffb31d0a907944bd022250ed8 (patch)
tree7d68daf8a6d0ca48037ce86fe59218d5d6afc619 /gdb/testsuite/gdb.base/run-after-attach.c
parent60f02a58bf59d2cc355aa8ba56f8111477972d89 (diff)
downloadgdb-e9756d52bea3834ffb31d0a907944bd022250ed8.zip
gdb-e9756d52bea3834ffb31d0a907944bd022250ed8.tar.gz
gdb-e9756d52bea3834ffb31d0a907944bd022250ed8.tar.bz2
Unset attach_flag when running a new process
We currently set attach_flag when attaching to a process, so we should make sure to unset it when forking a new process. Otherwise attach_flag would remain set after forking, if the previous process associated with the inferior was attached to. gdb/ChangeLog: * target.c (target_pre_inferior): Unset attach_flag. gdb/testsuite/ChangeLog: * gdb.base/run-after-attach.exp: New test file. * gdb.base/run-after-attach.c: New test file.
Diffstat (limited to 'gdb/testsuite/gdb.base/run-after-attach.c')
-rw-r--r--gdb/testsuite/gdb.base/run-after-attach.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/run-after-attach.c b/gdb/testsuite/gdb.base/run-after-attach.c
new file mode 100644
index 0000000..2398f00
--- /dev/null
+++ b/gdb/testsuite/gdb.base/run-after-attach.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+
+int
+main (void)
+{
+ sleep (600);
+ return 0;
+}