libdwarf
Functions
Dwarf_Error Functions

Functions

Dwarf_Unsigned dwarf_errno (Dwarf_Error dw_error)
 What DW_DLE code does the error have? More...
 
char * dwarf_errmsg (Dwarf_Error dw_error)
 What message string is in the error? More...
 
char * dwarf_errmsg_by_number (Dwarf_Unsigned dw_errornum)
 What message string is associated with the error number. More...
 
void dwarf_error_creation (Dwarf_Debug dw_dbg, Dwarf_Error *dw_error, char *dw_errmsg)
 Creating an error. This is very rarely helpful. It lets the library user create a Dwarf_Error and associate any string with that error. Your code could then return DW_DLV_ERROR to your caller when your intent is to let your caller clean up whatever seems wrong. More...
 
void dwarf_dealloc_error (Dwarf_Debug dw_dbg, Dwarf_Error dw_error)
 Free (dealloc) an Dwarf_Error something created. More...
 

Detailed Description

These functions aid in understanding handling.

Function Documentation

◆ dwarf_errno()

Dwarf_Unsigned dwarf_errno ( Dwarf_Error  dw_error)
Parameters
dw_errorThe dw_error should be non-null and a valid Dwarf_Error.
Returns
A DW_DLE value of some kind. For example: DW_DLE_DIE_NULL.

◆ dwarf_errmsg()

char* dwarf_errmsg ( Dwarf_Error  dw_error)
Parameters
dw_errorThe dw_error should be non-null and a valid Dwarf_Error.
Returns
A string with a message related to the error.

◆ dwarf_errmsg_by_number()

char* dwarf_errmsg_by_number ( Dwarf_Unsigned  dw_errornum)
Parameters
dw_errornumThe dw_error should be an integer from the DW_DLE set. For example, DW_DLE_DIE_NULL.
Returns
The generic string describing that error number.

◆ dwarf_error_creation()

void dwarf_error_creation ( Dwarf_Debug  dw_dbg,
Dwarf_Error dw_error,
char *  dw_errmsg 
)
Parameters
dw_dbgThe relevant Dwarf_Debug.
dw_errora Dwarf_Error is returned through this pointer.
dw_errmsgThe message string you provide.

◆ dwarf_dealloc_error()

void dwarf_dealloc_error ( Dwarf_Debug  dw_dbg,
Dwarf_Error  dw_error 
)
Parameters
dw_dbgThe relevant Dwarf_Debug pointer.
dw_errorA pointer to a Dwarf_Error. The pointer is then stale so you should immediately zero that pointer passed in.