Re: solaris gdb screen mayhem

From: wwieser@gmx.de
Date: 08/31/01


From: wwieser@gmx.de
Message-Id: <200108311145.NAA04755@enigma.deepspace.net>
To: ant@notatla.demon.co.uk (Antonomasia)
Subject: Re: solaris gdb screen mayhem
Date: Fri, 31 Aug 2001 13:45:33 +0200

On Wednesday 29 August 2001 23:51, you wrote:
>    Execution on a non-executable stack gets a SEGV.   Is there a way
>    the program can distinguish this from any other SEGV ?
>
Read the manual for sigaction(2).
Use the signal handler void (*sa_sigaction)(int, siginfo_t *, void *);
(you will have to set SA_SIGINFO in sa_flags).

Now, in the signal handler routine, analyze siginfo_t:
si_code will show you if SIGSEGV/BUS was generated by kill(2) or kill(1)
or by the kernel. You even get the address causing the fault in
si_addr.

The stuff seems to be POSIX.1b so I guess solaris implements it.

wwieser