[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] Question about memory references

From: Konstantin Belousov
Subject: Re: [Libunwind-devel] Question about memory references
Date: Thu, 11 Oct 2012 08:04:45 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 10, 2012 at 03:37:53PM -0700, Arun Sharma wrote:
> On Wed, Oct 10, 2012 at 9:21 AM, Harald Servat <address@hidden> wrote:
> > Hello list,
> >
> >   I was wondering whether in the recent development of libunwind if the
> > library gives the possibility to know which is the effective address
> > that is being accessed in a sighandler (not the Program Counter itself,
> > but the memory referenced, if the PC pointed to a Load/Store op). Or if
> > this functionality is out of the scope of libunwind and must be done
> > through other libraries/tools (and if any, do you have any clue?).
> I'd say this is out of the scope of libunwind. A couple of suggestions:
> * SA_SIGINFO can provide the faulting address for some signals
> * PEBS/IBS on x86 CPUs have this capability (as a profiling tool).
> Relevant patches have been posted multiple times on linux-kernel, but
> haven't made it to mainline yet.
> * If nothing else works, you could try to use a x86 instruction
> decoder and compute the effective address by interpreting the
> instruction.

If CPU did reported the faulted address, then you can get it for sure
on FreeBSD/x86 or x86_64. The kernel passes a fully populated ucontext_t
to the handler, which contains the snaphot of the register file at the
fault time, as well as mc_err field, which is the CPU error as pushed
on stack by microcode.

I expect a similar mechanism available for other Unixes.

Attachment: pgpfZBjzp0Yhq.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]