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]
Other format: [Raw text]

[RFA] Provide alternate signal handler match for alpha-linux-tdep.c


I've run across an Alpha linux-gnu port that uses a different
signal handler return stub.

-Fred

2002-05-01  Fred Fish  <fnf@redhat.com>

	* alpha-linux-tdep.c (alpha_linux_sigtramp_offset): Match
	alternate signal handler code sequence.

Index: alpha-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-linux-tdep.c,v
retrieving revision 1.5
diff -c -p -r1.5 alpha-linux-tdep.c
*** alpha-linux-tdep.c	26 Apr 2002 07:05:34 -0000	1.5
--- alpha-linux-tdep.c	1 May 2002 16:21:02 -0000
***************
*** 25,39 ****
  
  #include "alpha-tdep.h"
  
! /* Under GNU/Linux, signal handler invocations can be identified by the
!    designated code sequence that is used to return from a signal
     handler.  In particular, the return address of a signal handler
!    points to the following sequence (the first instruction is quadword
!    aligned):
    
!    bis $30,$30,$16
!    addq $31,0x67,$0
!    call_pal callsys 
        
     Each instruction has a unique encoding, so we simply attempt to
     match the instruction the pc is pointing to with any of the above
--- 25,45 ----
  
  #include "alpha-tdep.h"
  
! /* Under GNU/Linux, signal handler invocations can be identified by
!    the designated code sequence that is used to return from a signal
     handler.  In particular, the return address of a signal handler
!    points to one of the following sequences (the first instruction is
!    quadword aligned):
    
!      bis $30,$30,$16    0x47de0410
!      addq $31,0x67,$0   0x43ecf400
!      callsys            0x00000083
! 
!    or
! 
!      mov sp, a0         0x47fe0410
!      lda v0,103(zero)   0x201f0067
!      callsys            0x00000083
        
     Each instruction has a unique encoding, so we simply attempt to
     match the instruction the pc is pointing to with any of the above
*************** alpha_linux_sigtramp_offset (CORE_ADDR p
*** 59,73 ****
    off = -1;
    switch (w)
      {
!     case 0x47de0410:
        off = 0;
!       break;			/* bis $30,$30,$16 */
!     case 0x43ecf400:
        off = 4;
!       break;			/* addq $31,0x67,$0 */
!     case 0x00000083:
        off = 8;
!       break;			/* call_pal callsys */
      default:
        return -1;
      }
--- 65,81 ----
    off = -1;
    switch (w)
      {
!     case 0x47de0410:		/* bis $30,$30,$16 */
!     case 0x47fe0410:		/* mov sp,a0 */
        off = 0;
!       break;
!     case 0x43ecf400:		/* addq $31,0x67,$0 */
!     case 0x201f0067:		/* lda v0,103(zero) */
        off = 4;
!       break;
!     case 0x00000083:		/* call_pal callsys */
        off = 8;
!       break;
      default:
        return -1;
      }
*************** alpha_linux_sigtramp_offset (CORE_ADDR p
*** 81,86 ****
--- 89,97 ----
      return -1;
  
    if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083)
+     return off;
+ 
+   if (i[0] == 0x47fe0410 && i[1] == 0x201f0067 && i[2] == 0x00000083)
      return off;
  
    return -1;


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