Main index | Section 3 | Options |
#include <libdwarf.h>
Argument dbg denotes a valid Dwarf_Debug instance. Argument err will be used to record error information in case of an error.
After a call to dwarf_finish() or dwarf_object_finish(), the argument dbg will be invalid and should not be used further.
For Dwarf_Debug descriptors opened using dwarf_init(3), the application would need to explicitly release the Elf instance associated with the descriptor by first retrieving the instance using dwarf_get_elf(3) and closing it using elf_end(3).
Dwarf_Debug dbg; Dwarf_Error de;if (dwarf_finish(dbg, &de) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_finish: %s", dwarf_errmsg(de));
To deallocate a Dwarf_Debug instance allocated using dwarf_object_init(3) use:
Dwarf_Debug dbg; Dwarf_Error de;if (dwarf_object_finish(dbg, &de) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_object_finish: %s", dwarf_errmsg(de));
To deallocate a Dwarf_Debug instance allocated using dwarf_init(3) use:
Dwarf_Debug dbg; Dward_Error de; Elf *e;if (dwarf_get_elf(dbg, &e, &de) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_get_elf: %s", dwarf_errmsg(&de));
if (dwarf_finish(dbg, &de) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_finish: %s", dwarf_errmsg(de));
(void) elf_end(e);
DWARF_FINISH (3) | November 9, 2011 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A UNIX saleslady, Lenore, Enjoys work, but she likes the beach more. She found a good way To combine work and play: She sells C shells by the seashore. |
” |