libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] Question about memory references


From: Harald Servat
Subject: Re: [Libunwind-devel] Question about memory references
Date: Thu, 11 Oct 2012 10:17:15 +0200

El dj 11 de 10 de 2012 a les 08:04 +0300, en/na Konstantin Belousov va
escriure:
> 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.

Ok, thank you very much for the feedback Arun and Konstantin. I will
look at the alternatives you mention.


WARNING / LEGAL TEXT: This message is intended only for the use of the
individual or entity to which it is addressed and may contain
information which is privileged, confidential, proprietary, or exempt
from disclosure under applicable law. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, you are strictly prohibited from disclosing,
distributing, copying, or in any way using this message. If you have
received this communication in error, please notify the sender and
destroy and delete any copies you may have received.

http://www.bsc.es/disclaimer



reply via email to

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