libdwarf: Examining Section Group data

libdwarf

Loading...
Searching...
No Matches
Examining Section Group data

Example accessing Section Group data.

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.

*/
void examplesecgroup(Dwarf_Debug dbg)
{
int res = 0;
Dwarf_Unsigned section_count = 0;
Dwarf_Unsigned group_count;
Dwarf_Unsigned selected_group = 0;
Dwarf_Unsigned group_map_entry_count = 0;
Dwarf_Unsigned *sec_nums = 0;
Dwarf_Unsigned *group_nums = 0;
const char ** sec_names = 0;
Dwarf_Error error = 0;
Dwarf_Unsigned i = 0;
res = dwarf_sec_group_sizes(dbg,&section_count,
&group_count,&selected_group, &group_map_entry_count,
&error);
if (res != DW_DLV_OK) {
/* Something is badly wrong
Dwarf_Error
struct Dwarf_Error_s * Dwarf_Error
Definition libdwarf.h:611
Dwarf_Debug
struct Dwarf_Debug_s * Dwarf_Debug
Definition libdwarf.h:617
Dwarf_Unsigned
unsigned long long Dwarf_Unsigned
Definition libdwarf.h:196
dwarf_sec_group_sizes
DW_API 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.