Example getting source file names given a DIE.
*/
{
char **srcfiles = 0;
int res = 0;
&table_count,&line_context,error);
if (res != DW_DLV_OK) {
return res;
}
if (res != DW_DLV_OK) {
return res;
}
for (i = 0; i < count; ++i) {
if (lineversion == 5) {
propernumber = i;
} else {
propernumber = i+1;
}
printf("File %4ld %s\n",(unsigned long)propernumber,
srcfiles[i]);
srcfiles[i] = 0;
}
return DW_DLV_OK;
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:603
struct Dwarf_Die_s * Dwarf_Die
Definition: libdwarf.h:608
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:597
struct Dwarf_Line_Context_s * Dwarf_Line_Context
Definition: libdwarf.h:697
unsigned char Dwarf_Small
Definition: libdwarf.h:204
signed long long Dwarf_Signed
Definition: libdwarf.h:197
unsigned long long Dwarf_Unsigned
Definition: libdwarf.h:196
void dwarf_dealloc(Dwarf_Debug dw_dbg, void *dw_space, Dwarf_Unsigned dw_type)
The generic dealloc (free) function. It requires you know the correct DW_DLA value to pass in,...
int dwarf_srcfiles(Dwarf_Die dw_cu_die, char ***dw_srcfiles, Dwarf_Signed *dw_filecount, Dwarf_Error *dw_error)
The list of source files from the line table header.
void dwarf_srclines_dealloc_b(Dwarf_Line_Context dw_context)
Dealloc the memory allocated by dwarf_srclines_b.
int dwarf_srclines_b(Dwarf_Die dw_cudie, Dwarf_Unsigned *dw_version_out, Dwarf_Small *dw_table_count, Dwarf_Line_Context *dw_linecontext, Dwarf_Error *dw_error)
Initialize Dwarf_Line_Context for line table access.