Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* fix interrupt.exp for hpux11
@ 2002-09-06 13:55 Jeff Law
  2002-09-09 17:50 ` Elena Zannoni
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Law @ 2002-09-06 13:55 UTC (permalink / raw)
  To: gdb-patches


This is a repost of a patch I submitted last year, but which was
never approved.  It's incorrect to use TT_PROC_CONTINUE in this
context due to its inability to pass along (or clear pending) signals.

This fixes interrupt.exp for hpux11.


	* infttrace.c (child_resume): Simplify and rework to avoid
	TT_PROC_CONTINUE.

Index: infttrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infttrace.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 infttrace.c
*** infttrace.c	21 Jan 2002 01:27:01 -0000	1.19
--- infttrace.c	6 Sep 2002 20:51:47 -0000
*************** child_resume (ptid_t ptid, int step, enu
*** 4539,4636 ****
  
    else
      {
!       /* TT_LWP_CONTINUE can pass signals to threads,
!        * TT_PROC_CONTINUE can't.  So if there are any
!        * signals to pass, we have to use the (slower)
!        * loop over the stopped threads.
!        *
!        * Equally, if we have to not continue some threads,
!        * due to saved events, we have to use the loop.
!        */
!       if ((signal != 0) || saved_signals_exist ())
! 	{
! 	  if (resume_all_threads)
! 	    {
! 
! #ifdef THREAD_DEBUG
! 	      if (debug_on)
! 		printf ("Doing a continue by loop of all threads\n");
! #endif
  
! 	      threads_continue_all_with_signals (tid, signal);
! 
! 	      clear_all_handled ();
! 	      clear_all_stepping_mode ();
! 	    }
! 
! 	  else
! 	    {
  #ifdef THREAD_DEBUG
! 	      printf ("Doing a continue w/signal of just thread %d\n", tid);
  #endif
  
! 	      threads_continue_one_with_signal (tid, signal);
  
! 	      /* Clear the "handled" state of this thread, because
! 	       * we'll soon get a new event for it.  Other events
! 	       * can stay as they were.
! 	       */
! 	      clear_handled (tid);
! 	      clear_stepping_mode (tid);
! 	    }
  	}
- 
        else
  	{
- 	  /* No signals to send.
- 	   */
- 	  if (resume_all_threads)
- 	    {
- #ifdef THREAD_DEBUG
- 	      if (debug_on)
- 		printf ("Doing a continue by process of process %d\n", tid);
- #endif
- 
- 	      if (more_events_left > 0)
- 		{
- 		  warning ("Losing buffered events on continue.");
- 		  more_events_left = 0;
- 		}
- 
- 	      call_ttrace (TT_PROC_CONTINUE,
- 			   tid,
- 			   TT_NIL,
- 			   TT_NIL,
- 			   TT_NIL);
- 
- 	      clear_all_handled ();
- 	      clear_all_stepping_mode ();
- 	    }
- 
- 	  else
- 	    {
  #ifdef THREAD_DEBUG
! 	      if (debug_on)
! 		{
! 		  printf ("Doing a continue of just thread %d\n", tid);
! 		  if (is_terminated (tid))
! 		    printf ("Why are we continuing a dead thread? (5)\n");
! 		}
  #endif
  
! 	      call_ttrace (TT_LWP_CONTINUE,
! 			   tid,
! 			   TT_NIL,
! 			   TT_NIL,
! 			   TT_NIL);
  
! 	      /* Clear the "handled" state of this thread, because
! 	       * we'll soon get a new event for it.  Other events
! 	       * can stay as they were.
! 	       */
! 	      clear_handled (tid);
! 	      clear_stepping_mode (tid);
! 	    }
  	}
      }
  
--- 4539,4579 ----
  
    else
      {
!       /* TT_LWP_CONTINUE can pass signals to threads, TT_PROC_CONTINUE can't.
! 	 Therefore, we really can't use TT_PROC_CONTINUE here.
  
! 	 Consider a process which stopped due to signal which gdb decides
! 	 to handle and not pass on to the inferior.  In that case we must
! 	 clear the pending signal by restarting the inferior using
! 	 TT_LWP_CONTINUE and pass zero as the signal number.  Else the
! 	 pending signal will be passed to the inferior.  interrupt.exp
! 	 in the testsuite does this precise thing and fails due to the
! 	 unwanted signal delivery to the inferior.  */
!       if (resume_all_threads)
! 	{
  #ifdef THREAD_DEBUG
! 	  if (debug_on)
! 	    printf ("Doing a continue by loop of all threads\n");
  #endif
  
! 	  threads_continue_all_with_signals (tid, signal);
  
! 	  clear_all_handled ();
! 	  clear_all_stepping_mode ();
  	}
        else
  	{
  #ifdef THREAD_DEBUG
! 	  printf ("Doing a continue w/signal of just thread %d\n", tid);
  #endif
  
! 	  threads_continue_one_with_signal (tid, signal);
  
! 	  /* Clear the "handled" state of this thread, because we
! 	     will soon get a new event for it.  Other events can
! 	     stay as they were.  */
! 	  clear_handled (tid);
! 	  clear_stepping_mode (tid);
  	}
      }
  




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fix interrupt.exp for hpux11
  2002-09-06 13:55 fix interrupt.exp for hpux11 Jeff Law
@ 2002-09-09 17:50 ` Elena Zannoni
  2002-09-09 21:12   ` Andrew Cagney
  2002-09-10 10:36   ` Jeff Law
  0 siblings, 2 replies; 5+ messages in thread
From: Elena Zannoni @ 2002-09-09 17:50 UTC (permalink / raw)
  To: law; +Cc: gdb-patches

Jeff Law writes:
 > 
 > This is a repost of a patch I submitted last year, but which was
 > never approved.  It's incorrect to use TT_PROC_CONTINUE in this
 > context due to its inability to pass along (or clear pending) signals.
 > 
 > This fixes interrupt.exp for hpux11.
 > 
 > 
 > 	* infttrace.c (child_resume): Simplify and rework to avoid
 > 	TT_PROC_CONTINUE.

I don't see any harm in this. The file is only used for hpux11. There
are no current maintainers, and you were the previous maintainer, so,
sure, go ahead.

Elena

 > 
 > Index: infttrace.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/infttrace.c,v
 > retrieving revision 1.19
 > diff -c -3 -p -r1.19 infttrace.c
 > *** infttrace.c	21 Jan 2002 01:27:01 -0000	1.19
 > --- infttrace.c	6 Sep 2002 20:51:47 -0000
 > *************** child_resume (ptid_t ptid, int step, enu
 > *** 4539,4636 ****
 >   
 >     else
 >       {
 > !       /* TT_LWP_CONTINUE can pass signals to threads,
 > !        * TT_PROC_CONTINUE can't.  So if there are any
 > !        * signals to pass, we have to use the (slower)
 > !        * loop over the stopped threads.
 > !        *
 > !        * Equally, if we have to not continue some threads,
 > !        * due to saved events, we have to use the loop.
 > !        */
 > !       if ((signal != 0) || saved_signals_exist ())
 > ! 	{
 > ! 	  if (resume_all_threads)
 > ! 	    {
 > ! 
 > ! #ifdef THREAD_DEBUG
 > ! 	      if (debug_on)
 > ! 		printf ("Doing a continue by loop of all threads\n");
 > ! #endif
 >   
 > ! 	      threads_continue_all_with_signals (tid, signal);
 > ! 
 > ! 	      clear_all_handled ();
 > ! 	      clear_all_stepping_mode ();
 > ! 	    }
 > ! 
 > ! 	  else
 > ! 	    {
 >   #ifdef THREAD_DEBUG
 > ! 	      printf ("Doing a continue w/signal of just thread %d\n", tid);
 >   #endif
 >   
 > ! 	      threads_continue_one_with_signal (tid, signal);
 >   
 > ! 	      /* Clear the "handled" state of this thread, because
 > ! 	       * we'll soon get a new event for it.  Other events
 > ! 	       * can stay as they were.
 > ! 	       */
 > ! 	      clear_handled (tid);
 > ! 	      clear_stepping_mode (tid);
 > ! 	    }
 >   	}
 > - 
 >         else
 >   	{
 > - 	  /* No signals to send.
 > - 	   */
 > - 	  if (resume_all_threads)
 > - 	    {
 > - #ifdef THREAD_DEBUG
 > - 	      if (debug_on)
 > - 		printf ("Doing a continue by process of process %d\n", tid);
 > - #endif
 > - 
 > - 	      if (more_events_left > 0)
 > - 		{
 > - 		  warning ("Losing buffered events on continue.");
 > - 		  more_events_left = 0;
 > - 		}
 > - 
 > - 	      call_ttrace (TT_PROC_CONTINUE,
 > - 			   tid,
 > - 			   TT_NIL,
 > - 			   TT_NIL,
 > - 			   TT_NIL);
 > - 
 > - 	      clear_all_handled ();
 > - 	      clear_all_stepping_mode ();
 > - 	    }
 > - 
 > - 	  else
 > - 	    {
 >   #ifdef THREAD_DEBUG
 > ! 	      if (debug_on)
 > ! 		{
 > ! 		  printf ("Doing a continue of just thread %d\n", tid);
 > ! 		  if (is_terminated (tid))
 > ! 		    printf ("Why are we continuing a dead thread? (5)\n");
 > ! 		}
 >   #endif
 >   
 > ! 	      call_ttrace (TT_LWP_CONTINUE,
 > ! 			   tid,
 > ! 			   TT_NIL,
 > ! 			   TT_NIL,
 > ! 			   TT_NIL);
 >   
 > ! 	      /* Clear the "handled" state of this thread, because
 > ! 	       * we'll soon get a new event for it.  Other events
 > ! 	       * can stay as they were.
 > ! 	       */
 > ! 	      clear_handled (tid);
 > ! 	      clear_stepping_mode (tid);
 > ! 	    }
 >   	}
 >       }
 >   
 > --- 4539,4579 ----
 >   
 >     else
 >       {
 > !       /* TT_LWP_CONTINUE can pass signals to threads, TT_PROC_CONTINUE can't.
 > ! 	 Therefore, we really can't use TT_PROC_CONTINUE here.
 >   
 > ! 	 Consider a process which stopped due to signal which gdb decides
 > ! 	 to handle and not pass on to the inferior.  In that case we must
 > ! 	 clear the pending signal by restarting the inferior using
 > ! 	 TT_LWP_CONTINUE and pass zero as the signal number.  Else the
 > ! 	 pending signal will be passed to the inferior.  interrupt.exp
 > ! 	 in the testsuite does this precise thing and fails due to the
 > ! 	 unwanted signal delivery to the inferior.  */
 > !       if (resume_all_threads)
 > ! 	{
 >   #ifdef THREAD_DEBUG
 > ! 	  if (debug_on)
 > ! 	    printf ("Doing a continue by loop of all threads\n");
 >   #endif
 >   
 > ! 	  threads_continue_all_with_signals (tid, signal);
 >   
 > ! 	  clear_all_handled ();
 > ! 	  clear_all_stepping_mode ();
 >   	}
 >         else
 >   	{
 >   #ifdef THREAD_DEBUG
 > ! 	  printf ("Doing a continue w/signal of just thread %d\n", tid);
 >   #endif
 >   
 > ! 	  threads_continue_one_with_signal (tid, signal);
 >   
 > ! 	  /* Clear the "handled" state of this thread, because we
 > ! 	     will soon get a new event for it.  Other events can
 > ! 	     stay as they were.  */
 > ! 	  clear_handled (tid);
 > ! 	  clear_stepping_mode (tid);
 >   	}
 >       }
 >   
 > 
 > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fix interrupt.exp for hpux11
  2002-09-09 17:50 ` Elena Zannoni
@ 2002-09-09 21:12   ` Andrew Cagney
  2002-09-15 12:09     ` Elena Zannoni
  2002-09-10 10:36   ` Jeff Law
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-09-09 21:12 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: law, gdb-patches

Someone may want to pull this into the 5.3 branch.

Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fix interrupt.exp for hpux11
  2002-09-09 17:50 ` Elena Zannoni
  2002-09-09 21:12   ` Andrew Cagney
@ 2002-09-10 10:36   ` Jeff Law
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Law @ 2002-09-10 10:36 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

In message <15741.16771.968097.797722@localhost.redhat.com>, Elena Zannoni writ
es:
 >Jeff Law writes:
 > > 
 > > This is a repost of a patch I submitted last year, but which was
 > > never approved.  It's incorrect to use TT_PROC_CONTINUE in this
 > > context due to its inability to pass along (or clear pending) signals.
 > > 
 > > This fixes interrupt.exp for hpux11.
 > > 
 > > 
 > > 	* infttrace.c (child_resume): Simplify and rework to avoid
 > > 	TT_PROC_CONTINUE.
 >
 >I don't see any harm in this. The file is only used for hpux11. There
 >are no current maintainers, and you were the previous maintainer, so,
 >sure, go ahead.
FWIW, I never maintained infttrace -- that code came from HP and I've only
dug into it a couple times to fix bugs.

Anyway, at least this problem is fixed :-)

jeff


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fix interrupt.exp for hpux11
  2002-09-09 21:12   ` Andrew Cagney
@ 2002-09-15 12:09     ` Elena Zannoni
  0 siblings, 0 replies; 5+ messages in thread
From: Elena Zannoni @ 2002-09-15 12:09 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Elena Zannoni, law, gdb-patches

Andrew Cagney writes:
 > Someone may want to pull this into the 5.3 branch.
 > 
 > Andrew

Done
Elena


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-15 19:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-06 13:55 fix interrupt.exp for hpux11 Jeff Law
2002-09-09 17:50 ` Elena Zannoni
2002-09-09 21:12   ` Andrew Cagney
2002-09-15 12:09     ` Elena Zannoni
2002-09-10 10:36   ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox