libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] Function Address


From: David Mosberger-Tang
Subject: Re: [Libunwind-devel] Function Address
Date: Mon, 13 Aug 2007 10:40:34 -0600

That should be fine.  It would be nice if we could provide the default
(empty) implementation of get_func_addr() in one of the (dwarf)
header-files, such that platforms that don't need this magic don't
have to do anything special (you could use a feature control macro
such as LIBUNWIND_HAVE_TDEP_GET_FUNC_ADDR for this purpose).

  --david

On 8/10/07, Jose Flavio <address@hidden> wrote:
>
> > So, let's see: for get_proc_name you need to look up the
> > function-descriptor that covers the  current IP and then use that
> > symbol, right?  It seems to me that elfXX_get_proc_name() needs to do
> > whatever magic is needed for PPC64.
> >
>
> Yes, in truth the magic would be in lookup_symbol(..),
> Thats why I initially added a t_dep_get_func_addr(..),
>
> in ppc64 would be like that:
>
> int tdep_get_func_addr (unw_addr_space_t as, unw_word_t addr,
>                     unw_word_t *func_addr, void *arg)
> {
>   unw_word_t offset;
>   unw_accessors_t *a;
>
>   a = unw_get_accessors (as);
>   return (a->access_mem) (as, addr, func_addr, 0, arg) < 0;
> }
>
> and in x386 it would only return the same given address.
> To resolve a function symbol in ppc64 you need one more step, which is
> to go to OPD section (TOC) and get the real function address there.
>
> Thanks,
> Flávio
>
>


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




reply via email to

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