libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] [patch] Fixup start_ip in unw_get_proc_info when n


From: David Mosberger-Tang
Subject: Re: [Libunwind-devel] [patch] Fixup start_ip in unw_get_proc_info when no dwarf info
Date: Mon, 8 Oct 2007 12:56:53 -0600

Mark,

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?

Thanks,

  --david

On 10/2/07, Mark Wielaard <address@hidden> wrote:
> Hi,
>
> We use the following patch in frysk for unw_get_proc_info to get the
> correct start_ip when dwarf_make_proc_info fails. In that case we need
> to adjust the start_ip using unw_get_proc_name to get the right
> procedure start. Since we are only interested in the offset this patch
> also makes it so that a NULL bufp can be provided to unw_get_proc_name
> (including a small documentation update). This way the base address
> returned by unw_get_proc_info can always be reliably used in combination
> with later offsets returned by unw_get_proc_name (without this patch
> there is no way to know whether or not to use the offset because both
> unw_get_proc_info and unw_get_proc_name seem to succeed just fine).
>
> 2006-09-16  Alexandre Oliva  <address@hidden>
>
>         * src/x86/Gget_proc_info.c (unw_get_proc_info): Use
>         unw_get_proc_name to build a proper proc_info_t.
>         * src/x86_64/Gget_proc_info.c (unw_get_proc_info): Likewise.
>         * src/hppa/Gget_proc_info.c (unw_get_proc_info): Likewise.
>
> 2006-09-27  Alexandre Oliva  <address@hidden>
>
>     * src/elfxx.c (lookup_symbol): Cope with NULL buf and zero buf_len.
>     * src/mi/Gget_proc_name.c (intern_string, get_proc_name): Likewise.
>     * src/hppa/Gget_proc_info.c (unw_get_proc_info): Use it.
>     * src/x86/Gget_proc_info.c (unw_get_proc_info): Likewise.
>     * src/x86_64/Gget_proc_info.c (unw_get_proc_info): Likewise.
>     * doc/unw_get_proc_name.tex: Document NULL buf and zero buf_len.
>     * doc/unw_create_addr_space.tex (get_proc_name): Likewise.
>     * doc/unw_get_proc_name.man: Rebuilt.
>     * doc/unw_create_addr_space.man: Likewise.
>
> This doesn't introduce any test suite regressions (x86).
>
> Cheers,
>
> Mark
>
> _______________________________________________
> Libunwind-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/libunwind-devel
>
>
>


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




reply via email to

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