libunwind-devel
[Top][All Lists]
Advanced

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

Re: unw_get_reg vs current cursor ip (Was: [Libunwind-devel] [patch] Fix


From: David Mosberger-Tang
Subject: Re: unw_get_reg vs current cursor ip (Was: [Libunwind-devel] [patch] Fixup start_ip in unw_get_proc_info when no dwarf info)
Date: Tue, 11 Dec 2007 13:21:08 -0700

Mark,

Sorry for the late response --- I thought I had replied earlier.

I'm fine with the patch in principe, but I think it needs to go into a
dwarf-specific file ("mi" stands for "machine-independent").

Regards,

  --david

On 11/19/07, Mark Wielaard <address@hidden> wrote:
> Hi David,
>
> On Mon, 2007-10-08 at 12:56 -0600, David Mosberger-Tang wrote:
> > I'm not sure I understand what the real issue is this patch is trying
> > to solve.  Using unw_get_proc_name() will *not* give you reliably the
> > starting address of the procedure.  It just gives you the address of a
> > preceding (hopefully nearby) label.  Perhaps Frysk is mixing
> > proc_info.start_ip and the info returned by unw_get_proc_name(), but I
> > don't understand exactly what's going on and why the current libunwind
> > behavior would be a problem.   Can you explain, perhaps with an
> > example?
>
> Indeed, that is what we were doing. And it took me some time to realize
> why we were trying to make unw_get_proc_info more accurate. It all comes
> down to wanting to have access the current IP of the cursor even though
> the frame might not have accurate dwarf info itself. So in some places
> we weren't using unw_get_reg(UNW_REG_IP), because that does a dwarf
> lookup of the ip, but went through unw_get_proc_info() and
> unw_get_proc_name() because those fell back to using the current cursor
> ip if the lookup failed. The following patch does the same for
> unw_get_reg() and makes things a little bit more efficient in general.
>
> 2007-11-19  Mark Wielaard  <address@hidden>
>
>     * src/mi/Gget_reg.c (unw_get_reg): Use cached value from cursor
>     when looking for UNW_REG_IP.
>
> If it looks sane it would be nice to get this in.
>
> Cheers,
>
> Mark
>
>


-- 
Mosberger Consulting LLC, http://www.mosberger-consulting.com/




reply via email to

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