Example accessing Section Group data.
With split dwarf your libdwarf calls after than the initial open are done against the base Dwarf_Dbg and libdwarf automatically looks in the open tied dbg when and as appropriate. the tied-dbg can be detached too, see example3 link, though you must call dwarf_finish() on the detached dw_tied_dbg, the library will not do that for you..
Section groups apply to Elf COMDAT groups too.
*/
{
int res = 0;
const char ** sec_names = 0;
&group_count,&selected_group, &group_map_entry_count,
&error);
if (res != DW_DLV_OK) {
return;
}
if (!sec_nums) {
return;
}
if (!group_nums) {
free(group_nums);
return;
}
sec_names = calloc(group_map_entry_count,sizeof(char*));
if (!sec_names) {
free(group_nums);
free(sec_nums);
return;
}
group_nums,sec_nums,sec_names,&error);
if (res != DW_DLV_OK) {
free(sec_names);
free(group_nums);
free(sec_nums);
}
for ( i = 0; i < group_map_entry_count; ++i) {
}
free(sec_names);
free(group_nums);
free(sec_nums);
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:603
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:597
unsigned long long Dwarf_Unsigned
Definition: libdwarf.h:196
int dwarf_sec_group_sizes(Dwarf_Debug dw_dbg, Dwarf_Unsigned *dw_section_count_out, Dwarf_Unsigned *dw_group_count_out, Dwarf_Unsigned *dw_selected_group_out, Dwarf_Unsigned *dw_map_entry_count_out, Dwarf_Error *dw_error)
Get Section Groups data counts.
int dwarf_sec_group_map(Dwarf_Debug dw_dbg, Dwarf_Unsigned dw_map_entry_count, Dwarf_Unsigned *dw_group_numbers_array, Dwarf_Unsigned *dw_sec_numbers_array, const char **dw_sec_names_array, Dwarf_Error *dw_error)
Return a map between group numbers and section numbers.