This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tweak debug output of PTRACE_EVENT_CLONE handling

Another debug output tweak.  There's now a path that
doesn't print the child's pid anywhere, which is quite
useful to see in the debug logs.  This fixes it.


Pedro Alves

2011-10-11  Pedro Alves  <>

	* linux-nat.c (linux_handle_extended_wait): Always dump both the
	parent and child's pids as soon as we detect a clone event.
	Adjust another debug message.

 gdb/linux-nat.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Index: src/gdb/linux-nat.c
--- src.orig/gdb/linux-nat.c	2011-10-11 15:41:08.338606619 +0100
+++ src/gdb/linux-nat.c	2011-10-11 15:53:26.648606483 +0100
@@ -2218,6 +2218,12 @@ linux_handle_extended_wait (struct lwp_i
 	  ourstatus->kind = TARGET_WAITKIND_IGNORE;
+	  if (debug_linux_nat)
+	    fprintf_unfiltered (gdb_stdlog,
+				"LHEW: Got clone event "
+				"from LWP %d, new child is LWP %ld\n",
+				pid, new_pid);
 	  new_lp = add_lwp (BUILD_LWP (new_pid, GET_PID (lp->ptid)));
 	  new_lp->cloned = 1;
 	  new_lp->stopped = 1;
@@ -2322,9 +2328,7 @@ linux_handle_extended_wait (struct lwp_i
 	  if (debug_linux_nat)
 	    fprintf_unfiltered (gdb_stdlog,
-				"LHEW: Got clone event "
-				"from LWP %ld, resuming\n",
-				GET_LWP (lp->ptid));
+				"LHEW: resuming parent LWP %d\n", pid);
 	  linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
 				0, TARGET_SIGNAL_0);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]