This is the mail archive of the gdb-patches@sources.redhat.com 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]

[patch] change printf to fprintf_unfiltered.


Andrew Cagney wrote:
> 
> Michael Snyder wrote:
> 
> > !             if (debug_lin_lwp)
> > !               printf ("Delayed SIGSTOP caught for %s.\n",
> > !                       target_pid_to_str (lp->pid));
> > !
> 
> FYI, once this is in, someone should go through and change the
> printf()'s to:

OK:
2001-05-01  Michael Snyder  <msnyder@redhat.com>

	* lin-lwp.c: Change printf to fprintf_unfiltered.

Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 lin-lwp.c
*** lin-lwp.c	2001/04/30 20:25:07	1.12
--- lin-lwp.c	2001/05/01 20:36:46
*************** stop_wait_callback (struct lwp_info *lp,
*** 520,526 ****
  				 target_pid_to_str (lp->pid));
  	    }
  	  if (debug_lin_lwp)
! 	    printf ("%s exited.\n", target_pid_to_str (lp->pid));
  
  	  delete_lwp (lp->pid);
  	  return 0;
--- 520,527 ----
  				 target_pid_to_str (lp->pid));
  	    }
  	  if (debug_lin_lwp)
! 	    fprintf_unfiltered (gdb_stdlog, 
! 				"%s exited.\n", target_pid_to_str (lp->pid));
  
  	  delete_lwp (lp->pid);
  	  return 0;
*************** stop_wait_callback (struct lwp_info *lp,
*** 549,557 ****
  		 thread will have already tripped on it.  */
  
  	      if (debug_lin_lwp)
! 		printf ("Tripped breakpoint at %lx in LWP %d"
! 			" while waiting for SIGSTOP.\n",
! 			(long) read_pc_pid (lp->pid), pid);
  
  	      /* Set the PC to before the trap.  */
  	      if (DECR_PC_AFTER_BREAK)
--- 550,559 ----
  		 thread will have already tripped on it.  */
  
  	      if (debug_lin_lwp)
! 		fprintf_unfiltered (gdb_stdlog,
! 				    "Tripped breakpoint at %lx in LWP %d"
! 				    " while waiting for SIGSTOP.\n",
! 				    (long) read_pc_pid (lp->pid), pid);
  
  	      /* Set the PC to before the trap.  */
  	      if (DECR_PC_AFTER_BREAK)
*************** stop_wait_callback (struct lwp_info *lp,
*** 560,567 ****
  	  else
  	    {
  	      if (debug_lin_lwp)
! 		printf ("Received %s in LWP %d while waiting for SIGSTOP.\n",
! 			strsignal (WSTOPSIG (status)), pid);
  
  	      /* The thread was stopped with a signal other than
  		 SIGSTOP, and didn't accidentiliy trip a breakpoint.
--- 562,570 ----
  	  else
  	    {
  	      if (debug_lin_lwp)
! 		fprintf_unfiltered (gdb_stdlog, 
! 				    "Received %s in LWP %d while waiting for SIGSTOP.\n",
! 				    strsignal (WSTOPSIG (status)), pid);
  
  	      /* The thread was stopped with a signal other than
  		 SIGSTOP, and didn't accidentiliy trip a breakpoint.
*************** lin_lwp_wait (int pid, struct target_wai
*** 620,627 ****
        if (lp)
  	{
  	  if (debug_lin_lwp)
! 	    printf ("Using pending wait status for LWP %d.\n",
! 		    GET_LWP (lp->pid));
  
  	  status = lp->status;
  	  lp->status = 0;
--- 623,631 ----
        if (lp)
  	{
  	  if (debug_lin_lwp)
! 	    fprintf_unfiltered (gdb_stdlog, 
! 				"Using pending wait status for LWP %d.\n",
! 				GET_LWP (lp->pid));
  
  	  status = lp->status;
  	  lp->status = 0;
*************** lin_lwp_wait (int pid, struct target_wai
*** 635,641 ****
    else if (is_lwp (pid))
      {
        if (debug_lin_lwp)
! 	printf ("Waiting for specific LWP %d.\n", GET_LWP (pid));
  
        /* We have a specific LWP to check.  */
        lp = find_lwp_pid (GET_LWP (pid));
--- 639,646 ----
    else if (is_lwp (pid))
      {
        if (debug_lin_lwp)
! 	fprintf_unfiltered (gdb_stdlog, 
! 			    "Waiting for specific LWP %d.\n", GET_LWP (pid));
  
        /* We have a specific LWP to check.  */
        lp = find_lwp_pid (GET_LWP (pid));
*************** lin_lwp_wait (int pid, struct target_wai
*** 645,652 ****
  
        if (debug_lin_lwp)
  	if (status)
! 	  printf ("Using pending wait status for LWP %d.\n",
! 		  GET_LWP (lp->pid));
  
        /* If we have to wait, take into account whether PID is a cloned
           process or not.  And we have to convert it to something that
--- 650,658 ----
  
        if (debug_lin_lwp)
  	if (status)
! 	  fprintf_unfiltered (gdb_stdlog, 
! 			      "Using pending wait status for LWP %d.\n",
! 			      GET_LWP (lp->pid));
  
        /* If we have to wait, take into account whether PID is a cloned
           process or not.  And we have to convert it to something that
*************** lin_lwp_wait (int pid, struct target_wai
*** 725,731 ****
  				     target_pid_to_str (lp->pid));
  		}
  	      if (debug_lin_lwp)
! 		printf ("%s exited.\n", target_pid_to_str (lp->pid));
  
  	      delete_lwp (lp->pid);
  
--- 731,739 ----
  				     target_pid_to_str (lp->pid));
  		}
  	      if (debug_lin_lwp)
! 		fprintf_unfiltered (gdb_stdlog, 
! 				    "%s exited.\n", 
! 				    target_pid_to_str (lp->pid));
  
  	      delete_lwp (lp->pid);
  
*************** lin_lwp_wait (int pid, struct target_wai
*** 743,750 ****
  	      && WSTOPSIG (status) == SIGSTOP)
  	    {
  	      if (debug_lin_lwp)
! 		printf ("Delayed SIGSTOP caught for %s.\n",
! 			target_pid_to_str (lp->pid));
  
  	      /* This is a delayed SIGSTOP.  */
  	      lp->signalled = 0;
--- 751,759 ----
  	      && WSTOPSIG (status) == SIGSTOP)
  	    {
  	      if (debug_lin_lwp)
! 		fprintf_unfiltered (gdb_stdlog, 
! 				    "Delayed SIGSTOP caught for %s.\n",
! 				    target_pid_to_str (lp->pid));
  
  	      /* This is a delayed SIGSTOP.  */
  	      lp->signalled = 0;

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