Linux-kernel mailing list archive 2000-01,: Re: Determining address which caused SEGV

# Re: Determining address which caused SEGV

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Sat, 8 Jan 2000 00:10:57 +0000

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: David Wragg: "Re: time_t size: The year 2038 bug?"
- Previous message: Joel Gerber: "Re: 2.3.31 fails compile (i386 bbootsect.s)"
- In reply to: Jeff Dike: "Re: Determining address which caused SEGV"
- Next in thread: Patrick J. LoPresti: "Re: Determining address which caused SEGV"
- Next in thread: Patrick J. LoPresti: "Re: Determining address which caused SEGV"
- Reply: Patrick J. LoPresti: "Re: Determining address which caused SEGV"

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/

- Next message: David Wragg: "Re: time_t size: The year 2038 bug?"
- Previous message: Joel Gerber: "Re: 2.3.31 fails compile (i386 bbootsect.s)"
- In reply to: Jeff Dike: "Re: Determining address which caused SEGV"
- Next in thread: Patrick J. LoPresti: "Re: Determining address which caused SEGV"
- Next in thread: Patrick J. LoPresti: "Re: Determining address which caused SEGV"
- Reply: Patrick J. LoPresti: "Re: Determining address which caused SEGV"