Re: Determining address which caused SEGV

From: Jamie Lokier (lkd@tantalophile.demon.co.uk)
Date: Fri Jan 07 2000 - 19:10:57 EST


Jeff Dike wrote:
> void user_segv_handler(int sig)
> {
> struct sigcontext_struct *sc;
> sc = (struct sigcontext_struct *) (&sig + 1);

You can just do this:

void user_segv_handler (int sig, struct sigcontext_struct context)
{
   unsigned long fault_address = context.cr2;
   // ...
}

-- Jamie

-
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/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:11 EST