Example of a libdwarf initialization call.
An example calling dwarf_init_path() and dwarf_finish()
- Parameters
-
path | Path to an object we wish to open. |
groupnumber | Desired groupnumber. Use DW_DW_GROUPNUMBER_ANY unless you have reason to do otherwise. |
- Returns
- Returns the applicable result. DW_DLV_OK etc.
*/
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;
}