Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* sigtramp offset on Linux/Alpha
@ 2001-05-01  8:53 Bharadwaj Yadavalli
  2001-05-01  9:39 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Bharadwaj Yadavalli @ 2001-05-01  8:53 UTC (permalink / raw)
  To: gdb

Hi!

The function long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR pc))
in gdb/alpha-tdep.c considers the following three instructions
as "signal trampoline":

   bis $30,$30,$16     (0x47de0410)
   addq $31,0x67,$0    (0x43ecf400)
   call_pal callsys    (0x00000083)

A quick look in rt_sigaction.S in 
glibc sources glibc-2.2.2/sysdeps/unix/sysv/linux/alpha/ reveals the 
following code for sigreturn

	.align	5
	.ent	sigreturn
sigreturn:
	.prologue 0
	mov	sp,a0
	ldi	v0,__NR_sigreturn
	callsys
	.end	sigreturn

which assembles as

<sigreturn>:	mov	sp,a0          (0x47fe0410)	
<sigreturn+4>:	lda	v0,103(zero)   (0x201f0067)	
<sigreturn+8>:	callsys                (0x00000083)
<sigreturn+12>:	unop	               (0x2fe00000)

I realize that the second instruction in the version gdb is working
with and that in rt_sigaction.S do the same thing - load an
immediate value into v0 - but their encodings are different.

So, Question 1:

Shouldn't the function alpha_linux_sigtramp_offset() be looking 
for the encoding 0x201f0067 instead of 0x43ecf400 in the second 
instruction?

Further, the "trampoline" for signals with siginfo_t table is different
according to p. 268 of the book "Understanding Linux Kernel". The return
enters at rt_sigreturn instead of sigreturn as far as I understand. The 
existence of rt_sigreturn seems to indicate the same. 

So, Question 2:

Shouldn't gdb be checking for the pc to be in the chunk as well? 
(Basically difference is in the second instruction).

<rt_sigreturn>:	        mov	sp,a0           (0x47fe0410)
<rt_sigreturn+4>:	lda	v0,351(zero)    (0x201f015f)
<rt_sigreturn+8>:	callsys                 (0x00000083)

Am I missing something that led me to the above question? Thanks 
in advance for any clarifications from folks in the know of the 
internals.

Bharadwaj


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

end of thread, other threads:[~2001-05-01  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-01  8:53 sigtramp offset on Linux/Alpha Bharadwaj Yadavalli
2001-05-01  9:39 ` Andrew Cagney

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