|
NAMEdwarf_init , dwarf_elf_init
—
allocate a DWARF debug descriptor
LIBRARYDWARF Access Library (libdwarf, -ldwarf)SYNOPSIS#include <libdwarf.h>
int
in
DESCRIPTIONThese functions allocate and return a Dwarf_Debug instance for the object denoted by argument fd or elf. This instance would be used for subsequent access to debugging information in the object by other functions in the DWARF(3) library.For function For function Argument mode specifies the access mode desired. It should be at least as permissive as the mode with which the file descriptor fd or the ELF descriptor elf was created with. Legal values for argument mode are:
Argument errhand denotes a function to be
called in case of an error. If this argument is Argument errarg is passed to the error handler function denoted by argument errhand when it is invoked. Argument ret points to the memory location that will hold a Dwarf_Debug reference on a successful call these functions. Argument err references a memory location that would hold a Dwarf_Error descriptor in case of an error. Memory ManagementThe Dwarf_Debug instance returned by these functions should be freed usingdwarf_finish ().
IMPLEMENTATION NOTESThe current implementation does not support access modesDW_DLC_RDWR and DW_DLC_WRITE .
RETURN VALUESThese functions return the following values:
EXAMPLESTo initialize a Dwarf_Debug instance from a open file descriptor referencing an ELF object, and with the default error handler, use:Dwarf_Error err; Dwarf_Debug dbg; if (dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dbg, &err) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_init: %s", dwarf_errmsg(err)); SEE ALSOdwarf(3), dwarf_errmsg(3), dwarf_finish(3), dwarf_get_elf(3), elf_begin(3), elf_memory(3)
Visit the GSP FreeBSD Man Page Interface. |