libdwarf
Reading Split Dwarf (Debug Fission) data

Example getting cu/tu name, offset.

*/
int exampleza(Dwarf_Xu_Index_Header xuhdr,
Dwarf_Unsigned offsets_count,
Dwarf_Error *error)
{
Dwarf_Unsigned col = 0;
/* We use 'offsets_count' returned by
a dwarf_get_xu_index_header() call.
We use 'index' returned by a
dwarf_get_xu_hash_entry() call. */
for (col = 0; col < offsets_count; col++) {
Dwarf_Unsigned off = 0;
Dwarf_Unsigned len = 0;
const char *name = 0;
Dwarf_Unsigned num = 0;
int res = 0;
col,&num,&name,error);
if (res == DW_DLV_ERROR) {
return res;
}
if (res == DW_DLV_NO_ENTRY) {
break;
}
index,col,&off,&len,error);
if (res == DW_DLV_ERROR) {
return res;
}
if (res == DW_DLV_NO_ENTRY) {
break;
}
/* Here we have the DW_SECT_ name and number
and the base offset and length of the
section data applicable to the hash
that got us here.
Use the values.*/
}
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_section_names(Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_column_index, Dwarf_Unsigned *dw_SECT_number, const char **dw_SECT_name, Dwarf_Error *dw_error)
get DW_SECT value for a column.
int dwarf_get_xu_section_offset(Dwarf_Xu_Index_Header dw_xuhdr, Dwarf_Unsigned dw_row_index, Dwarf_Unsigned dw_column_index, Dwarf_Unsigned *dw_sec_offset, Dwarf_Unsigned *dw_sec_size, Dwarf_Error *dw_error)
Get row data (section data) for a row and column.