Example of a libdwarf initialization call.
*/
int exampleinit(const char *path, unsigned groupnumber)
{
static char true_pathbuf[FILENAME_MAX];
unsigned tpathlen = FILENAME_MAX;
int res = 0;
tpathlen,groupnumber,errhand,
errarg,&dbg, &error);
if (res == DW_DLV_ERROR) {
return res;
}
if (res == DW_DLV_NO_ENTRY) {
return res;
}
printf("The file we actually opened is %s\n",
true_pathbuf);
return DW_DLV_OK;
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:603
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:597
void(* Dwarf_Handler)(Dwarf_Error dw_error, Dwarf_Ptr dw_errarg)
Definition: libdwarf.h:718
void * Dwarf_Ptr
Definition: libdwarf.h:208
void dwarf_dealloc_error(Dwarf_Debug dw_dbg, Dwarf_Error dw_error)
Free (dealloc) an Dwarf_Error something created.
int dwarf_init_path(const char *dw_path, char *dw_true_path_out_buffer, unsigned int dw_true_path_bufferlen, unsigned int dw_groupnumber, Dwarf_Handler dw_errhand, Dwarf_Ptr dw_errarg, Dwarf_Debug *dw_dbg, Dwarf_Error *dw_error)
Initialization based on path, the most common initialization.
int dwarf_finish(Dwarf_Debug dw_dbg)
Close the initialized dw_dbg and free all data libdwarf has for this dw_dbg.