libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] [PATCH 5/5] Search MiniDebugInfo for procedure nam


From: Martin Milata
Subject: Re: [Libunwind-devel] [PATCH 5/5] Search MiniDebugInfo for procedure names
Date: Mon, 13 Aug 2012 15:58:16 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Aug 11, 2012 at 21:34:35 -0700, Arun Sharma wrote:
> On Fri, Aug 10, 2012 at 7:03 AM, Martin Milata <address@hidden> wrote:
> 
> >
> > +      /* Closer symbol was found (possibly truncated). */
> > +      if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM)
> > +       {
> > +         ret = ret_mdi;
> > +       }
> > +
> > +      munmap (mdi.image, mdi.size);
> 
> If the second lookup fails with -UNW_ENOMEM, looks like you propagate
> that error up the stack. Why not propagate the best known answer from
> the first lookup?

The idea is that usually only the closest symbol is useful as it
corresponds to the procedure name. If the closest symbol is too large
and some other one that fits in the buffer is returned, it will most
likely be name of some unrelated procedure.

Also, such behaviour is consistent with what the original
unw_get_proc_name does - it returns the closest symbol regardless of
whether it's truncated or not. Or am I missing something?

Martin



reply via email to

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