[Top] [All Lists]

Re: questions on struct sigcontext

To: Chris Friesen <>
Subject: Re: questions on struct sigcontext
From: David Daney <>
Date: Wed, 12 Dec 2007 10:12:01 -0800
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Thunderbird (X11/20071019)
Chris Friesen wrote:

Hi all,

First, I'm not subscribed to the list so I'd appreciate being cc'd on any replies.

We have a project getting started with MIPS, and one of the things that we're trying to bring in is some exception-handling code that logs various information about the ways that apps fail.

In particular, the guys working on this have asked for the STATUS, CAUSE, BADVADDR, and FPC_EIR registers to be made available as part of struct sigcontext so that they can determine exactly why the app is failing.

Looking at include/asm-mips/sigcontext.h I can see that these registers appear to be in the struct, but are either marked as "unused" or now have different names.

Am I correct that these registers are not currently exported to userspace on a fault?


Most of the information is available. The si_addr and si_code of the sigcontext are populated as well as the ucontext at the fault.

Given all this and the code at $pc when the fault occurred, it is a simple matter to determine what happened.

I have seen some kernels patched so that an OOPS type dump was created in the trap handler, but this doesn't really add anything to the information that is already available in user space.

David Daney

<Prev in Thread] Current Thread [Next in Thread>