From b9d64d14283c417a1380f619e1a79484d3d5d3c8 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 25 Nov 2005 22:18:52 +0000 Subject: 2005-11-25 Michael Snyder * linux-nat.c (child_follow_fork): Add verbose messages when detaching from parent or child (to match HPUX tests in testsuite). --- gdb/ChangeLog | 5 +++++ gdb/linux-nat.c | 25 ++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3edcd14823f..70689618caf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2005-11-25 Michael Snyder + + * linux-nat.c (child_follow_fork): Add verbose messages when + detaching from parent or child (to match HPUX tests in testsuite). + 2005-11-23 Michael Snyder * linux-nat.c: Adapt fork list to work with follow_fork. diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index d7917369406..c79e6934bb7 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -371,17 +371,17 @@ child_follow_fork (struct target_ops *ops, int follow_child) also, but they'll be reinserted below. */ detach_breakpoints (child_pid); - if (debug_linux_nat) - { - target_terminal_ours (); - fprintf_unfiltered (gdb_stdlog, - "Detaching after fork from child process %d.\n", - child_pid); - } - /* Don't detach if doing forky command. */ if (detach_fork) { + if (1/*debug_linux_nat*/) + { + target_terminal_ours (); + fprintf_filtered (gdb_stdlog, + "Detaching after fork from child process %d.\n", + child_pid); + } + ptrace (PTRACE_DETACH, child_pid, 0, 0); } else @@ -497,7 +497,14 @@ child_follow_fork (struct target_ops *ops, int follow_child) fork_save_infrun_state (fp, 0); } else - target_detach (NULL, 0); + { + fprintf_filtered (gdb_stdlog, + "Detaching from program: %d. ", parent_pid); + fprintf_filtered (gdb_stdlog, + "Attaching after fork to process %d.\n", + child_pid); + target_detach (NULL, 0); + } inferior_ptid = pid_to_ptid (child_pid); -- cgit v1.2.1