libdwarf
Detaching a tied dbg

Example detaching a tied (executable) dbg.

See DWARF5 Appendix F on Split-DWARF.

With split dwarf your libdwarf calls after than the initial open are done against the split 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..

*/
int example3(Dwarf_Debug split_dbg,Dwarf_Error *error)
{
int res = 0;
res = dwarf_set_tied_dbg(split_dbg,NULL,error);
if (res != DW_DLV_OK) {
/* Something went wrong*/
return res;
}
return res;
}
struct Dwarf_Debug_s * Dwarf_Debug
Definition: libdwarf.h:586
struct Dwarf_Error_s * Dwarf_Error
Definition: libdwarf.h:580
int dwarf_set_tied_dbg(Dwarf_Debug dw_split_dbg, Dwarf_Debug dw_tied_dbg, Dwarf_Error *dw_error)
Use with split dwarf.