libdwarf: Dwarf_Error Functions

libdwarf

Loading...
Searching...
No Matches
Functions
Dwarf_Error Functions

## Functions
DW_API Dwarf_Unsigned | dwarf_errno (Dwarf_Error dw_error)
| What DW_DLE code does the error have?
DW_API char * | dwarf_errmsg (Dwarf_Error dw_error)
| What message string is in the error?
DW_API char * | dwarf_errmsg_by_number (Dwarf_Unsigned dw_errornum)
| What message string is associated with the error number.
DW_API 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.
DW_API void | dwarf_dealloc_error (Dwarf_Debug dw_dbg, Dwarf_Error dw_error)
| Free (dealloc) an Dwarf_Error something created.

## Detailed Description

These functions aid in understanding handling.

## Function Documentation

## ◆ dwarf_dealloc_error()

DW_API void dwarf_dealloc_error | ( | Dwarf_Debug | dw_dbg,
|  | Dwarf_Error | dw_error )

Free (dealloc) an Dwarf_Error something created.

Parameters

  dw_dbg | The relevant Dwarf_Debug pointer.
  dw_error | A pointer to a Dwarf_Error. The pointer is then stale so you should immediately zero that pointer passed in.

## ◆ dwarf_errmsg()

DW_API char * dwarf_errmsg | ( | Dwarf_Error | dw_error | ) |

What message string is in the error?

Parameters

  dw_error | The 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()

DW_API char * dwarf_errmsg_by_number | ( | Dwarf_Unsigned | dw_errornum | ) |

What message string is associated with the error number.

Parameters

  dw_errornum | The 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_errno()

DW_API Dwarf_Unsigned dwarf_errno | ( | Dwarf_Error | dw_error | ) |

What DW_DLE code does the error have?

Parameters

  dw_error | The 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_error_creation()

DW_API 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.

Parameters

  dw_dbg | The relevant Dwarf_Debug.
  dw_error | a Dwarf_Error is returned through this pointer.
  dw_errmsg | The message string you provide.