lkml.org 
[lkml]   [2000]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Determining address which caused SEGV
Date
From
> I am trying to write a signal handler for SEGV that can figure out
> what address was being accessed to cause the fault. Yes, I have a
> good reason for wanting this.

This is how I handle it. It requires no setup at handler registration time
(not that I did on purpose, anyway).

void user_segv_handler(int sig)
{
struct sigcontext_struct *sc;

sc = (struct sigcontext_struct *) (&sig + 1);
...
}

> Yes, I have a good reason for wanting this.

A bunch of people do. The above is taken from my user-mode port of the kernel.

Jeff



-
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:55    [W:0.189 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site