Example accessing gdbindex section data.
*/
{
const char * section_name = 0;
int res = 0;
&version,&cu_list_offset, &types_cu_list_offset,
&address_area_offset,&symbol_table_offset,
&constant_pool_offset, §ion_size,
§ion_name,error);
if (res != DW_DLV_OK) {
return res;
}
{
&length,error);
if (res != DW_DLV_OK) {
return res;
}
for (i = 0; i < length; ++i) {
i,&cuoffset,&culength,error);
if (res != DW_DLV_OK) {
return res;
}
}
&typeslength,error);
if (res != DW_DLV_OK) {
return res;
}
for (i = 0; i < typeslength; ++i) {
i,&cuoffset,&tuoffset,&type_signature,error);
if (res != DW_DLV_OK) {
return res;
}
}
}
return DW_DLV_OK;
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:603
struct Dwarf_Gdbindex_s * Dwarf_Gdbindex
Definition: libdwarf.h:687
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:597
unsigned long long Dwarf_Unsigned
Definition: libdwarf.h:196
int dwarf_gdbindex_header(Dwarf_Debug dw_dbg, Dwarf_Gdbindex *dw_gdbindexptr, Dwarf_Unsigned *dw_version, Dwarf_Unsigned *dw_cu_list_offset, Dwarf_Unsigned *dw_types_cu_list_offset, Dwarf_Unsigned *dw_address_area_offset, Dwarf_Unsigned *dw_symbol_table_offset, Dwarf_Unsigned *dw_constant_pool_offset, Dwarf_Unsigned *dw_section_size, const char **dw_section_name, Dwarf_Error *dw_error)
Open access to the .gdb_index section.
int dwarf_gdbindex_types_culist_array(Dwarf_Gdbindex dw_gdbindexptr, Dwarf_Unsigned *dw_types_list_length, Dwarf_Error *dw_error)
Return the types culist array length.
void dwarf_dealloc_gdbindex(Dwarf_Gdbindex dw_gdbindexptr)
Free (dealloc) all allocated Dwarf_Gdbindex memory It should named dwarf_dealloc_gdbindex.
int dwarf_gdbindex_culist_entry(Dwarf_Gdbindex dw_gdbindexptr, Dwarf_Unsigned dw_entryindex, Dwarf_Unsigned *dw_cu_offset, Dwarf_Unsigned *dw_cu_length, Dwarf_Error *dw_error)
For a CU entry in the list return the offset and length.
int dwarf_gdbindex_types_culist_entry(Dwarf_Gdbindex dw_gdbindexptr, Dwarf_Unsigned dw_types_entryindex, Dwarf_Unsigned *dw_cu_offset, Dwarf_Unsigned *dw_tu_offset, Dwarf_Unsigned *dw_type_signature, Dwarf_Error *dw_error)
For a types CU entry in the list returns the offset and length.
int dwarf_gdbindex_culist_array(Dwarf_Gdbindex dw_gdbindexptr, Dwarf_Unsigned *dw_list_length, Dwarf_Error *dw_error)
Return the culist array length.