[Dwarf-Discuss] libdwarf - Working with 64 bit images

Ron Louzon louzonr@yahoo.com
Wed Jul 13 17:55:16 GMT 2011

I have not modified the libDwarf code as it works great "as is".? I had looked 
at the dwarf_loc structure and I saw that the "number" fields were of type 
Dwarf_Unsigned.? I made the mistake of assuming they were equivalent to unsigned 
32 bit types but in actuality, they are 64 bit types.? It is great that you had 
the foresight to build this package to accomodate 64 bit data.? Thanks for the 

----- Original Message ----
From: David Anderson <davea42@earthlink.net>
To: dwarf-discuss at lists.dwarfstd.org
Sent: Fri, July 8, 2011 4:31:08 PM
Subject: Re: [Dwarf-Discuss] libdwarf - Working with 64 bit images

On 07/08/2011 11:59 AM, Ron Louzon wrote:
> I have been using libelf/libdwarf to parse 32-bit debug images.? I now need to
> accomodate 64-bit image files.? I enabled some libelf defines to allow the
> reading of those 64-bit image files.? After examining libdwarf, it appears to 
> that the 2 halves of 64-bit address data should be available in the Dwarf_loc
> structures as number1 and number 2.? Is there anything else I need to know as 
> attempt to parse these files?? Thanks.

Unless you have done something special (why would you?) the types
for all? libdwarf fields are such that they all hold 64bit values.
So the address data (regardless if 32 or 64 bits) will be in individual fields.

libdwarf has always done everything in 64bit signed/unsigned at all times
(except the fields like the DWARF version and a few others that are defined
to be smaller than 64 bits).

So reading 64 bits requires no effort on your part other than getting the
libelf that has the 64bit interfaces (and indeed I would expect 64bit libelf 
functions to be
on any libelf one would be likely to find!).


-- The thunder was ominous sounding, much like the sound of a thin sheet of 
metal being shaken backstage during the storm scene in a play. -- Barbara 

Dwarf-Discuss mailing list
Dwarf-Discuss at lists.dwarfstd.org

More information about the Dwarf-discuss mailing list