libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] Function Address


From: Jose Flavio
Subject: Re: [Libunwind-devel] Function Address
Date: Fri, 10 Aug 2007 15:55:35 -0300

> 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





reply via email to

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