aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.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/target.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/target.c')
-rw-r--r--gdb/target.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 1710e0c..ea541aa 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2138,6 +2138,10 @@ target_pre_inferior (int from_tty)
target_clear_description ();
}
+ /* attach_flag may be set if the previous process associated with
+ the inferior was attached to. */
+ current_inferior ()->attach_flag = 0;
+
agent_capability_invalidate ();
}