libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] Re: [patch] Implement _Unwind_GetIPInfo (GCC PR target


From: Jan Kratochvil
Subject: [Libunwind-devel] Re: [patch] Implement _Unwind_GetIPInfo (GCC PR target/27880)
Date: Wed, 1 Apr 2009 16:22:00 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, 01 Apr 2009 15:02:54 +0200, Jakub Jelinek wrote:
> > +PROTECTED unsigned long
> > +_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
> > +{
> > +  unw_word_t val;
> > +
> > +  unw_get_reg (&context->cursor, UNW_REG_IP, &val);
> > +  *ip_before_insn = unw_is_signal_frame (&context->cursor);
> > +  return val;
> > +}
> 
> I'm not sure if this setting of *ip_before_insn is right for ia64 though,

As this function is currently arch-independent in libunwind it is at least
right for non-ia64 (DWARF) systems.  Just on these systems existing GCC
configurations are probably not going to use libunwind for their exceptions
unwinding and libunwind itself has currently no use of _Unwind_GetIPInfo.


> But I think on ia64 the unwinder never subtracts anything when looking up
> FDEs (that would suggest maybe *ip_before_insn = 1 should be used), but I'm
> not aware of any problems reported with the *ip_before_insn = 0 usage on ia64.
> I guess this needs to be carefully investigated.

During my test ia64 behaves like x86:  For segfaulting instruction the return
address points at the instruction itself.  For a regular call the return
address points after the call.

Failed to create by gcc-4.3.2.ia64 a function with a `call' in either its
first slot or the last slot of the function so IMO it does not matter for the
EH frame determination and I have no problem using `*ip_before_insn = 0;'
instead.

For ia64 I also do not see any subtraction in libunwind.

For x86 upstream libunwind itself still uses `--ip;' unconditionally in
dwarf/Gparser.c:fetch_proc_info().  unw_step() was made signal-frame aware by
dwarf_cursor->decrease_ip in the Fedora/Frysk patchset.
http://cvs.fedora.redhat.com/viewvc/rpms/libunwind/devel/libunwind-snap-070224-frysk20070405cvs.patch?revision=1.1


Thanks,
Jan




reply via email to

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