From: Michael Snyder Date: Fri, 25 Nov 2005 22:18:52 +0000 (+0000) Subject: 2005-11-25 Michael Snyder X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=338e2996f0ad15ca425cd2b5d9e1f13cd2ef3a86;p=thirdparty%2Fbinutils-gdb.git 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). --- 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);