aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2013-09-03 17:22:45 +0000
committerLuis Machado <luisgpm@br.ibm.com>2013-09-03 17:22:45 +0000
commit07107ca6f983e2dde5fa669a56563760a1f44c11 (patch)
treedbc1afaf4e0a4a854a1761f333bbccc64a0c3e72 /gdb/infrun.c
parent3bec276888142e4f751eaf9011f02b049fed7295 (diff)
downloadgdb-07107ca6f983e2dde5fa669a56563760a1f44c11.zip
gdb-07107ca6f983e2dde5fa669a56563760a1f44c11.tar.gz
gdb-07107ca6f983e2dde5fa669a56563760a1f44c11.tar.bz2
* inf-child.c (inf_child_follow_fork) New parameter
detach_fork. * inf-ptrace.c (inf_ptrace_follow_fork): Likewise. * inf-ttrace.c (inf_ttrace_follow_fork): Likewise. * inferior.h (detach_fork): Remove. * infrun.c (detach_fork): Adjust comment and make it static. (follow_fork): Pass detach_fork parameter to target_follow_fork. * linux-nat.c (linux_child_follow_fork): New parameter detach_fork. * target.c (target_follow_fork): New parameter detach_fork. Pass detach_fork as parameter and print its value. * target.h (struct target_ops) <to_follow_fork>: New int parameter. (target_follow_fork): New parameter detach_fork.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index dc1036d..57618ae 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -132,8 +132,12 @@ int sync_execution = 0;
static ptid_t previous_inferior_ptid;
-/* Default behavior is to detach newly forked processes (legacy). */
-int detach_fork = 1;
+/* If set (default for legacy reasons), when following a fork, GDB
+ will detach from one of the fork branches, child or parent.
+ Exactly which branch is detached depends on 'set follow-fork-mode'
+ setting. */
+
+static int detach_fork = 1;
int debug_displaced = 0;
static void
@@ -497,7 +501,7 @@ follow_fork (void)
/* Tell the target to do whatever is necessary to follow
either parent or child. */
- if (target_follow_fork (follow_child))
+ if (target_follow_fork (follow_child, detach_fork))
{
/* Target refused to follow, or there's some other reason
we shouldn't resume. */