DWARF_GET_TYPES(3) | Library Functions Manual | DWARF_GET_TYPES(3) |
int
dwarf_get_types(Dwarf_Debug dbg, Dwarf_Type **types, Dwarf_Signed *ntypes, Dwarf_Error *err);
int
dwarf_type_cu_offset(Dwarf_Type type, Dwarf_Off *cu_offset, Dwarf_Error *err);
int
dwarf_type_die_offset(Dwarf_Type type, Dwarf_Off *die_offset, Dwarf_Error *err);
int
dwarf_type_name_offsets(Dwarf_Type type, char **name, Dwarf_Off *die_offset, Dwarf_Off *cu_die_offset, Dwarf_Error *err);
int
dwarf_typename(Dwarf_Type type, char **name, Dwarf_Error *err);
Standards-conformant applications should use the functions dwarf_get_pubtypes(3), dwarf_pubtype_cu_offset(3), dwarf_pubtype_die_offset(3), dwarf_pubtype_name_offsets(3) and dwarf_pubtypename(3), which operate on the equivalent “.debug_pubtypes” section defined by the DWARF3 standard.
Information about user-defined types is returned using opaque descriptors of type Dwarf_Type. Applications need to use the functions described below to retrieve the name and offset information contained in these descriptors.
Function dwarf_get_types() retrieves descriptors for all user-defined types associated with the DWARF debug context specified by argument dbg. The argument types should point to a location that will be set to a pointer to an array of Dwarf_Type descriptors. The argument ntypes should point to a location that will be set to the number of descriptors returned.
Function dwarf_type_cu_offset() returns the offset, relative to the “.debug_info” section, of the compilation unit that contains the debugging information entry associated with the argument type. Argument cu_offset should point to a location that will hold the returned offset.
Function dwarf_type_die_offset() retrieves the offset, relative to the “.debug_info” section, of the debugging information entry associated with the argument type, and stores it into the location pointed to by the argument die_offset.
Function dwarf_type_name_offsets() retrieves the name and offsets for the debugging information entry for argument type. Argument 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 die_offset should point to a location which will be set to the offset, relative to the “.debug_info” section, of the associated debugging information entry. Argument cu_die_offset should point to a location which will be set to a offset, relative to the “.debug_info” section, of the first debugging information entry in the compilation unit associated with argument type.
Function dwarf_typename() sets the location pointed to by argument name to a pointer to a NUL-terminated string holding the name of the debugging information entry associated with the argument type.
The memory area used for the string returned in the name argument to functions dwarf_type_name_offsets() and dwarf_typename() 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.
April 10, 2011 | NetBSD 7.2 |