lkml.org 
[lkml]   [2000]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.2.17pre15 and SA_SIGINFO
Miquel van Smoorenburg writes:
> In article >3987CA65.B4BDBCD2@transmeta.com>,
> H. Peter Anvin <hpa@transmeta.com> wrote:
> >I have a program which relies on being able to derive the address of
> >a SIGSEGV. To do that, I use the SA_SIGINFO option to sigaction() and
[...]
> Well, I can't help you with that, but I know of an alternative for
> i386 at least:
>
> #include <signal.h>
>
> void segv_handler(int sig, struct sigcontext ctx)
> {
> void *addr = (void *)ctx.eip;

eip gives the instruction pointer. It's cr2 that gives the address
of the page fault.

--Malcolm

--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Unix Systems Programmer
Oxford University Computing Services

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.033 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site