DWARF_GET_FUNCS(3)
π DWARF_GET_FUNCS(3) β Library Functions Manual β¨
Hey bestie! This page is all about grabbing info on static functions out of libdwarf, and honestly? It's giving very niche but very iconic. π«Ά
πΈ NAME
dwarf_get_funcs, dwarf_func_cu_offset, dwarf_func_die_offset, dwarf_func_name_offsets, dwarf_funcname β retrieve information about static functions π
π LIBRARY
DWARF Access Library (libdwarf, -ldwarf) π¦
π οΈ SYNOPSIS
#include <libdwarf.h>
int
dwarf_get_funcs(Dwarf_Debug dbg, Dwarf_Func **funcs,
Dwarf_Signed *nfuncs, Dwarf_Error *err);
int
dwarf_func_cu_offset(Dwarf_Func func, Dwarf_Off *cu_offset,
Dwarf_Error *err);
int
dwarf_func_die_offset(Dwarf_Func func, Dwarf_Off *die_offset,
Dwarf_Error *err);
int
dwarf_func_name_offsets(Dwarf_Func func, char **name,
Dwarf_Off *die_offset, Dwarf_Off *cu_die_offset, Dwarf_Error *err);
int
dwarf_funcname(Dwarf_Func func, char **name, Dwarf_Error *err);
β¨ DESCRIPTION
Okay so these functions pull info about static functions from the lookup tables in the SGI-specific .debug_funcnames section. The info comes back in opaque descriptors of type Dwarf_Func, and you use the functions below to get the name and offset details out of those descriptors. No cap. π
dwarf_get_funcs()β retrieves descriptors for all the static functions associated with the DWARF debug context specified by argumentdbg. Argumentfuncsshould point to a location that will be set to a pointer to an array ofDwarf_Funcdescriptors. Argumentnfuncsshould point to a location that will be set to the number of descriptors returned. β¨dwarf_func_cu_offset()β returns the offset, relative to the.debug_infosection, of the compilation unit that contains the debugging information entry associated with argumentfunc. Argumentcu_offsetshould point to a location that will hold the returned offset. πdwarf_func_die_offset()β retrieves the offset, relative to the.debug_infosection, of the debugging information entry associated with argumentfunc, and stores it into the location pointed to by argumentdie_offset. π¦dwarf_func_name_offsets()β retrieves the name and offsets for the debugging information entry for argumentfunc. Argumentnameshould point to a location which will be set to a pointer to a NUL-terminated string containing the name of the associated debugging information entry. Argumentdie_offsetshould point to a location which will be set to the offset, relative to the.debug_infosection, of the associated debugging information entry. Argumentcu_die_offsetshould point to a location which will be set to the offset, relative to the.debug_infosection, of the first debugging information entry in the compilation unit associated with argumentfunc. πdwarf_funcname()β sets the location pointed to by argumentnameto a pointer to a NUL-terminated string holding the name of the debugging information entry associated with argumentfunc. πΈ
π§ Memory Management
The memory area used for the array of Dwarf_Func descriptors returned in argument funcs by function dwarf_get_funcs() is owned by the DWARF Access Library (libdwarf, -ldwarf). Application code should not attempt to directly free this pointer. Portable code should instead use the function dwarf_funcs_dealloc(3) to indicate that the memory area may be freed. π«Ά
The memory area used for the string returned in the name argument to functions dwarf_func_name_offsets() and dwarf_funcname() is owned by the DWARF Access Library (libdwarf, -ldwarf). Portable code should indicate that the memory area can be freed using the dwarf_dealloc(3) function. π
π¨ Error Returns
If argument err is not NULL, these functions will use it to store error information, in case of an error. π«‘
π― RETURN VALUES
On success, these functions return DW_DLV_OK. In case of an error, they return DW_DLV_ERROR and set the argument err. Periodt. π
π ERRORS
These functions may fail with the following errors:
DW_DLE_ARGUMENTβ One of the argumentscu_die_offset,cu_offset,dbg,die_offset,func,funcs,name, ornfuncswasNULL. πDW_DLE_NO_ENTRYβ The DWARF debugging context referenced by argumentdbgdid not contain information about static functions. π
π SEE ALSO
dwarf(3), dwarf_funcs_dealloc(3), dwarf_get_cu_die_offset_given_cu_header_offset(3) π
π«Ά xoxo, your Debian libdwarf bestie β this DWARF_GET_FUNCS(3) page is dated April 10, 2011. π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: libdwarf 15.0.0
- Copyright (c) 2011 Kai Wang
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms