libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] [PATCH 3/5] Rework the lookup of the ARM specific


From: Arun Sharma
Subject: Re: [Libunwind-devel] [PATCH 3/5] Rework the lookup of the ARM specific unwind entry for local unwinding
Date: Sat, 6 Aug 2011 12:54:20 -0700

On Wed, Aug 3, 2011 at 5:12 AM, Ken Werner <address@hidden> wrote:
> Use the dh_iterate_phdr callback in Gfind_proc_info-lsb.c to find the ARM
> specific unwind tables rather than doing it on our own at the unw_init_local.

You probably meant dl_iterate_phdr?

> index 6c94f05..584f392 100644
> --- a/include/libunwind-dynamic.h
> +++ b/include/libunwind-dynamic.h
> @@ -75,7 +75,8 @@ typedef enum
>   {
>     UNW_INFO_FORMAT_DYNAMIC,           /* unw_dyn_proc_info_t */
>     UNW_INFO_FORMAT_TABLE,             /* unw_dyn_table_t */
> -    UNW_INFO_FORMAT_REMOTE_TABLE       /* unw_dyn_remote_table_t */
> +    UNW_INFO_FORMAT_REMOTE_TABLE,      /* unw_dyn_remote_table_t */
> +    UNW_INFO_FORMAT_ARM_EXIDX          /* ARM specific unwind info */

Could you add a reference to the doc that describes ARM_EXIDX some place?
Not sure if this is the right one.
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf

> diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c
> index d65342c..5c1931d 100644
> --- a/src/dwarf/Gfind_proc_info-lsb.c
> +++ b/src/dwarf/Gfind_proc_info-lsb.c
> @@ -57,6 +57,9 @@ struct callback_data
>     int single_fde;            /* did we find a single FDE? (vs. a table) */
>     unw_dyn_info_t di;         /* table info (if single_fde is false) */
>     unw_dyn_info_t di_debug;   /* additional table info for .debug_frame */
> +#if UNW_TARGET_ARM
> +    unw_dyn_info_t di_arm;     /* additional table info for .ARM.exidx */
> +#endif
>   };

I'm a bit concerned about the arch-specific stuff getting added to
callback_data. What are the minimal arch specific hooks you need to
get this to work without an #ifdef UNW_TARGET_ARM? Something along the
lines of:

unw_dyn_info_t *di_tdep;


> @@ -783,14 +809,21 @@ dwarf_find_proc_info (unw_addr_space_t as, unw_word_t 
> ip,
>
>   /* search the table: */
>   if (cb_data.di.format != -1)
> -    ret = dwarf_search_unwind_table (as, ip, &cb_data.di,
> -                                     pi, need_unwind_info, arg);
> +    ret = tdep_search_unwind_table (as, ip, &cb_data.di,
> +                                   pi, need_unwind_info, arg);
>   else
>     ret = -UNW_ENOINFO;
>
> +#if UNW_TARGET_ARM
> +  if (ret == -UNW_ENOINFO && cb_data.di_arm.format != -1)
> +    ret = tdep_search_unwind_table (as, ip, &cb_data.di_arm, pi,
> +                                   need_unwind_info, arg);
> +#endif
> +
>   if (ret == -UNW_ENOINFO && cb_data.di_debug.format != -1)
> -    ret = dwarf_search_unwind_table (as, ip, &cb_data.di_debug, pi,
> -                                    need_unwind_info, arg);
> +    ret = tdep_search_unwind_table (as, ip, &cb_data.di_debug, pi,
> +                                   need_unwind_info, arg);
> +
>   return ret;

I'd like to minimize the number of calls between dwarf_find_proc_info
and target dependent code. Two sounds better than three.

 -Arun



reply via email to

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