* stack layout in signal handling proc
@ 1998-06-03 20:08 dragisha
1998-06-03 23:51 ` Uncle George
1998-06-05 6:48 ` Richard Henderson
0 siblings, 2 replies; 3+ messages in thread
From: dragisha @ 1998-06-03 20:08 UTC (permalink / raw)
To: axp-list
hi,
is there someone kind knowledgeable and kind to enlighten me on above
mentioned subject? I am searching through various .h's and few doc's without
much success (my code in question still does not work :).
standard (?) behaviour is to put one integer (signum) some
not-well-defined structure (sigcontext?) whose size is something like 19x8
bytes. and one integer (code) and then jump to signal handler. Does gdb know
how to interpret program stack inside signal handling procedure? who is
responsible for stack cleaning on exit?
Thanks in advance,
dragisha
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: stack layout in signal handling proc
1998-06-03 20:08 stack layout in signal handling proc dragisha
@ 1998-06-03 23:51 ` Uncle George
1998-06-05 6:48 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Uncle George @ 1998-06-03 23:51 UTC (permalink / raw)
To: axp-list
stack setup and unwinding is done inside the kernel.
on a sig, the current environment is placed on the user stack, and the
parameters to the sig handler is placed in registers( the first 6 parms to a
routine are place in registers )
although u should only get a signum as a parameter to the sig handler, i beleive
that there are 2 more. I think the third parameter is a pointer to the saved
area ( as saved by the kern).
unwinding is done when ur sig handler does a jsr 0(26) which then executes a
small pgm left on the stack by the kernel, which then traps to the kern, wher
the kern will fix up the stack and continue from the saved pc address ( while in
the sig routine, u can change the return address to be something else )
dragisha@frodo.ho.com wrote:
> hi,
>
> is there someone kind knowledgeable and kind to enlighten me on above
> mentioned subject? I am searching through various .h's and few doc's without
> much success (my code in question still does not work :).
>
> standard (?) behaviour is to put one integer (signum) some
> not-well-defined structure (sigcontext?) whose size is something like 19x8
> bytes. and one integer (code) and then jump to signal handler. Does gdb know
> how to interpret program stack inside signal handling procedure? who is
> responsible for stack cleaning on exit?
>
> Thanks in advance,
> dragisha
>
>
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: stack layout in signal handling proc
1998-06-03 20:08 stack layout in signal handling proc dragisha
1998-06-03 23:51 ` Uncle George
@ 1998-06-05 6:48 ` Richard Henderson
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 1998-06-05 6:48 UTC (permalink / raw)
To: dragisha, axp-list
On Wed, Jun 03, 1998 at 10:08:25PM +0200, dragisha@frodo.ho.com wrote:
> is there someone kind knowledgeable and kind to enlighten me on above
> mentioned subject? I am searching through various .h's and few doc's without
> much success (my code in question still does not work :).
Without POSIX.1b signals in the 2.1 kernels, we follow Digial Unix:
int handler (int sig, int code, struct sigcontext *ctx)
where struct sigcontext is defined in <asm/sigcontext.h>.
With POSIX.1b signals, and with SA_SIGINFO set in the sigaction struct,
we follow POSIX:
int handler (int sig, siginfo_t *, ucontext_t *)
where ucontext_t will eventually show up in <ucontext.h>.
> Does gdb know how to interpret program stack inside signal handling
> procedure?
I think so.
> who is responsible for stack cleaning on exit?
Um? The kernel, assuming you return from the handler naturally.
If you leave through longjmp, it happens that way. All unicies
work this way.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-06-05 6:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-06-03 20:08 stack layout in signal handling proc dragisha
1998-06-03 23:51 ` Uncle George
1998-06-05 6:48 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox