From e9756d52bea3834ffb31d0a907944bd022250ed8 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 29 Jul 2015 20:03:43 -0400 Subject: 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. --- gdb/target.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/target.c') 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 (); } -- cgit v1.1