p Function .Fn dwarf_get_vars retrieves descriptors for all the static variables associated with the DWARF debug context specified by argument .Fa dbg . The argument .Fa vars should point to a location that will be set to a pointer to an array of .Vt Dwarf_Var descriptors. The argument .Fa nvars should point to a location that will be set to the number of descriptors returned.
p Function .Fn dwarf_var_cu_offset returns the section-relative offset, relative to the .Dq ".debug_info" section, of the compilation unit that contains the debugging information entry associated with the argument .Fa var . Argument .Fa cu_offset should point to a location that will hold the returned offset.
p Function .Fn dwarf_var_die_offset retrieves the section-relative offset, relative to the .Dq ".debug_info" section, of the debugging information entry associated with the argument .Fa var , and stores it into the location pointed to by the argument .Fa die_offset .
p Function .Fn dwarf_var_name_offsets retrieves both the name and the associated offsets for the debugging information entry for argument .Fa var . Argument .Fa name should 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. Argument .Fa die_offset should point to a location which will be set to a section-relative offset, relative to the .Dq ".debug_info" section, of the associated debugging information entry. Argument .Fa cu_die_offset should point to a location which will be set to a section-relative offset, relative to the .Dq ".debug_info" section, of the first debugging information entry in the compilation unit associated with argument .Fa var .
p Function .Fn dwarf_varname sets the location pointed to by argument .Fa name to a pointer to a NUL-terminated string holding the name of the debugging information entry associated with the argument .Fa var . .Ss Memory Management The memory area used for the array of .Vt Dwarf_Var descriptors returned in argument .Fa vars by function .Fn dwarf_get_vars is owned by the .Lb libdwarf . Application code should not attempt to directly free this pointer. Portable code should instead use the function .Xr dwarf_vars_dealloc 3 to indicate that the memory area may be freed.
p The memory area used for the string returned in the .Fa name argument to functions .Fn dwarf_var_name_offsets and .Fn dwarf_varname is owned by the .Lb libdwarf . Portable code should indicate that the memory area can be freed using the .Xr dwarf_dealloc 3 function. .Ss Error Returns If argument .Fa err is not .Dv NULL , these functions will use it to store error information, in case of an error. .Sh RETURN VALUES On success, these functions returns .Dv DW_DLV_OK . In case of an error, they return .Dv DW_DLV_ERROR and set the argument .Fa err . .Sh ERRORS These functions may fail with the following errors: l -tag -width ".Bq Er DW_DLE_ARGUMENT" t Bq Er DW_DLE_ARGUMENT One of the arguments .Va cu_die_offset , .Va cu_offset , .Va dbg , .Va die_offset , .Va var , .Va vars , .Va name , or .Va nvars was .Dv NULL . .El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_dealloc 3 , .Xr dwarf_get_cu_die_offset_given_cu_header_offset 3 , .Xr dwarf_vars_dealloc 3