libdwarf
Loading...
Searching...
No Matches
Reading Split Dwarf (Debug Fission) hash slots

Example using dwarf_get_xu_hash_entry()

*/
int examplez( Dwarf_Xu_Index_Header xuhdr,
Dwarf_Unsigned hash_slots_count,
Dwarf_Error *error)
{
/* hash_slots_count returned by
dwarf_get_xu_index_header() */
static Dwarf_Sig8 zerohashval;
for (h = 0; h < hash_slots_count; h++) {
Dwarf_Sig8 hashval;
Dwarf_Unsigned index = 0;
int res = 0;
res = dwarf_get_xu_hash_entry(xuhdr,h,
&hashval,&index,error);
if (res != DW_DLV_OK) {
return res;
}
if (!memcmp(&hashval,&zerohashval,
sizeof(Dwarf_Sig8)) && index == 0 ) {
/* An unused hash slot */
continue;
}
/* Here, hashval and index (a row index into
offsets and lengths) are valid. Do
something with them */
}
return DW_DLV_OK;
}
struct Dwarf_Xu_Index_Header_s * Dwarf_Xu_Index_Header
Definition libdwarf.h:693
struct Dwarf_Error_s * Dwarf_Error
Definition libdwarf.h:597
unsigned long long Dwarf_Unsigned
Definition libdwarf.h:196
int dwarf_get_xu_hash_entry(Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_index, Dwarf_Sig8 *dw_hash_value, Dwarf_Unsigned *dw_index_to_sections, Dwarf_Error *dw_error)
Get a Hash Entry.
Definition libdwarf.h:313