This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Issues with dwarf APIs


Hi -

> [...]
> 2. dwarf_getlocation_addr(&Dwarf_attribute, addr, &expr,len,1)
>     addr: Is current Program counter with in the function boundaries , 
> [...]
> case 2: Is failing even when Dwarf_location Tab is present in the dwarf 
> [...]
> In function die for pseries_dedicated_idle_sleep (in ppc64)
> readelf -wi vmlinux reads:
> -------------------------------------
>  <2><385581>: Abbrev Number: 96 (DW_TAG_variable)
>  1520738     <385582>   DW_AT_name        : cpu
>  1520739     <385586>   DW_AT_decl_file   : 1
>  1520740     <385587>   DW_AT_decl_line   : 484
>  1520741     <385589>   DW_AT_type        : <0x378b77>
>  1520742     <38558d>   DW_AT_location    : 0x5f804      (location list)
> [...]

Check out the location list contents (0x5f804).  Most likely the
address you supplied to dwarf_getlocation_addr is not within the range
of addresses that were encoded.  This could mean that the variable is
only partially in scope, or that at that particular moment (PC value),
it had no easily encoded location.

Be sure you're using the right PC.  If you're doing backtracing, your
PC value will only rarely happen to be the entry address of a
function; more frequently it will be in the middle (at a function call
site).

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]