This is the mail archive of the gdb-patches@sourceware.org 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]

[PATCH] Fix step-over-signal-handler with merged Linux targets


Hello,

since the recent Linux target rework, the sigstep and sigrepeat
test cases are failing for me.  The reason for this appears to be
the following short-cut in linux_nat_wait:

  /* Don't report signals that GDB isn't interested in, such as
     signals that are neither printed nor stopped upon.  Stopping all
     threads can be a bit time-consuming so if we want decent
     performance with heavily multi-threaded programs, especially when
     they're using a high frequency timer, we'd better avoid it if we
     can.  */

which didn't use to be active for single-threaded processes
prior to the target rework.

The problem with not reporting signals is that when a signal
is received while we are currenly single-stepping, gdb may need
to perform special actions, like transparently stepping out of
the signal handler.  Those actions no longer take place when
the short-cut is active.

As a fix I'd suggest to simply not invoking the short-cut when
single-stepping.  This fixes the test case regressions.

Tested on s390-ibm-linux and s390x-ibm-linux with no regressions.

OK for mainline?

Bye,
Ulrich

ChangeLog:

	* linux-nat.c (linux_nat_wait): Do not short-cut reporting
	of 'uninteresting' signals when single-stepping.


Index: gdb/linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.40
diff -c -p -r1.40 linux-nat.c
*** gdb/linux-nat.c	24 Mar 2006 23:08:16 -0000	1.40
--- gdb/linux-nat.c	29 Mar 2006 18:47:56 -0000
*************** retry:
*** 2152,2158 ****
      {
        int signo = target_signal_from_host (WSTOPSIG (status));
  
!       if (signal_stop_state (signo) == 0
  	  && signal_print_state (signo) == 0
  	  && signal_pass_state (signo) == 1)
  	{
--- 2152,2161 ----
      {
        int signo = target_signal_from_host (WSTOPSIG (status));
  
!       /* If we get a signal while single-stepping, we may need special
! 	 care, e.g. to skip the signal handler.  Defer to common code.  */
!       if (!lp->step
! 	  && signal_stop_state (signo) == 0
  	  && signal_print_state (signo) == 0
  	  && signal_pass_state (signo) == 1)
  	{
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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