Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dwarf_seterrarg(3) [freebsd man page]

DWARF_SETERRARG(3)					   BSD Library Functions Manual 					DWARF_SETERRARG(3)

NAME
dwarf_seterrarg, dwarf_seterrhand -- configure error handling LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> Dwarf_Ptr dwarf_seterrarg(Dwarf_Debug dbg, Dwarf_Ptr arg); Dwarf_Handler dwarf_seterrhand(Dwarf_Debug dbg, Dwarf_Handler handler); DESCRIPTION
These functions may be used by applications to configure error handling callbacks. The error handling scheme used by the library is described in dwarf(3). Function dwarf_seterrarg() may be used to set the callback argument passed to a configured error handler at the time it is invoked. Argument arg is the callback argument being set. Argument dbg can be a debug context allocated by a prior call to dwarf_init(3), or can be NULL to indicate that the library-wide callback argument is to be set. Function dwarf_seterrhand() may be used to associate an error handler denoted by argument handler with the DWARF debug context descriptor denoted by argument dbg. Argument dbg should be a debug context allocated by a prior call to dwarf_init(3), or may be NULL to indicate that the library-wide error handler is to be set. RETURN VALUES
Function dwarf_seterrhand() returns the previous error handler associated with argument dbg. If argument dbg is NULL, function dwarf_seterrhand() returns the previous library-wide error handler. Function dwarf_seterrarg() returns the previous callback argument associated with argument dbg. If argument dbg is NULL, function dwarf_seterrarg() returns the previous library-wide callback argument. COMPATIBILITY
The behavior of these functions when argument dbg is NULL is a local extension. ERRORS
These functions do not set an error code. SEE ALSO
dwarf(3), dwarf_init(3) BSD
May 01, 2010 BSD

Check Out this Related Man Page

DWARF_FINISH(3) 					   BSD Library Functions Manual 					   DWARF_FINISH(3)

NAME
dwarf_finish, dwarf_object_finish -- free resources associated with a debug descriptor LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> int dwarf_finish(Dwarf_Debug dbg, Dwarf_Error *err); int dwarf_object_finish(Dwarf_Debug dbg, Dwarf_Error *err); DESCRIPTION
The dwarf_finish() and dwarf_object_finish() functions are used to release the resources associated with a debug descriptor allocated by a prior call to dwarf_init(3) and dwarf_object_init(3) respectively. 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). RETURN VALUES
These functions return DW_DLV_OK if successful. In case of an error, the functions return DW_DLV_ERROR and record additional information in argument err. EXAMPLES
To deallocate a Dwarf_Debug instance allocated using dwarf_elf_init(3) use: 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); SEE ALSO
elf_end(3), dwarf_elf_init(3), dwarf_get_elf(3), dwarf_init(3), dwarf_object_init(3) BSD
November 9, 2011 BSD
Man Page