libdwarf
Functions
Fast Access to GNU .debug_gnu_pubnames

Functions

int dwarf_get_gnu_index_head (Dwarf_Debug dw_dbg, Dwarf_Bool dw_which_section, Dwarf_Gnu_Index_Head *dw_head, Dwarf_Unsigned *dw_index_block_count_out, Dwarf_Error *dw_error)
 Access to .debug_gnu_pubnames or .debug_gnu_pubtypes. More...
 
void dwarf_gnu_index_dealloc (Dwarf_Gnu_Index_Head dw_head)
 Free resources of .debug_gnu_pubnames .debug_gnu_pubtypes. More...
 
int dwarf_get_gnu_index_block (Dwarf_Gnu_Index_Head dw_head, Dwarf_Unsigned dw_number, Dwarf_Unsigned *dw_block_length, Dwarf_Half *dw_version, Dwarf_Unsigned *dw_offset_into_debug_info, Dwarf_Unsigned *dw_size_of_debug_info_area, Dwarf_Unsigned *dw_count_of_index_entries, Dwarf_Error *dw_error)
 Access a particular block. More...
 
int dwarf_get_gnu_index_block_entry (Dwarf_Gnu_Index_Head dw_head, Dwarf_Unsigned dw_blocknumber, Dwarf_Unsigned dw_entrynumber, Dwarf_Unsigned *dw_offset_in_debug_info, const char **dw_name_string, unsigned char *dw_flagbyte, unsigned char *dw_staticorglobal, unsigned char *dw_typeofentry, Dwarf_Error *dw_error)
 Access a particular entry of a block. More...
 

Detailed Description

Section .debug_gnu_pubnames or .debug_gnu_pubtypes.

This is a section created for and used by the GNU gdb debugger to access DWARF information.

Not part of standard DWARF.

Function Documentation

◆ dwarf_get_gnu_index_head()

int dwarf_get_gnu_index_head ( Dwarf_Debug  dw_dbg,
Dwarf_Bool  dw_which_section,
Dwarf_Gnu_Index_Head dw_head,
Dwarf_Unsigned dw_index_block_count_out,
Dwarf_Error dw_error 
)

Call this to get access.

Parameters
dw_dbgPass in the Dwarf_Debug of interest.
dw_which_sectionPass in TRUE to access .debug_gnu_pubnames. Pass in FALSE to access .debug_gnu_typenames.
dw_headOn success, set to a pointer to a head record allowing access to all the content of the section.
dw_index_block_count_outOn success, set to a count of the number of blocks of data available.
dw_error
Returns
Returns DW_DLV_OK, DW_DLV_NO_ENTRY (if the section does not exist or is empty), or, in case of an error reading the section, DW_DLV_ERROR.

◆ dwarf_gnu_index_dealloc()

void dwarf_gnu_index_dealloc ( Dwarf_Gnu_Index_Head  dw_head)

Call this to deallocate all memory used by dw_head.

Parameters
dw_headPass in the Dwarf_Gnu_Index_head whose data is to be deallocated.

◆ dwarf_get_gnu_index_block()

int dwarf_get_gnu_index_block ( Dwarf_Gnu_Index_Head  dw_head,
Dwarf_Unsigned  dw_number,
Dwarf_Unsigned dw_block_length,
Dwarf_Half dw_version,
Dwarf_Unsigned dw_offset_into_debug_info,
Dwarf_Unsigned dw_size_of_debug_info_area,
Dwarf_Unsigned dw_count_of_index_entries,
Dwarf_Error dw_error 
)
Parameters
dw_headPass in the Dwarf_Gnu_Index_head interest.
dw_numberPass in the block number of the block of interest. 0 through dw_index_block_count_out-1.
dw_block_lengthOn success set to the length of the data in this block, in bytes.
dw_versionOn success set to the version number of the block.
dw_offset_into_debug_infoOn success set to the offset, in .debug_info, of the data for this block. The returned offset may be outside the bounds of the actual .debug_info section, such a possibility does not cause the function to return DW_DLV_ERROR.
dw_size_of_debug_info_areaOn success set to the size in bytes, in .debug_info, of the area this block refers to. The returned dw_ dw_size_of_debug_info_are plus dw_offset_into_debug_info may be outside the bounds of the actual .debug_info section, such a possibility does not cause the function to return DW_DLV_ERROR. Use dwarf_get_section_max_offsets_d() to learn the size of .debug_info and optionally other sections as well.
dw_count_of_index_entriesOn success set to the count of index entries in this particular block number.
dw_errorOn error dw_error is set to point to the error details.
Returns
Returns DW_DLV_OK, DW_DLV_NO_ENTRY (if the section does not exist or is empty), or, in case of an error reading the section, DW_DLV_ERROR.

◆ dwarf_get_gnu_index_block_entry()

int dwarf_get_gnu_index_block_entry ( Dwarf_Gnu_Index_Head  dw_head,
Dwarf_Unsigned  dw_blocknumber,
Dwarf_Unsigned  dw_entrynumber,
Dwarf_Unsigned dw_offset_in_debug_info,
const char **  dw_name_string,
unsigned char *  dw_flagbyte,
unsigned char *  dw_staticorglobal,
unsigned char *  dw_typeofentry,
Dwarf_Error dw_error 
)

Access to a single entry in a block.

Parameters
dw_headPass in the Dwarf_Gnu_Index_head interest.
dw_blocknumberPass in the block number of the block of interest. 0 through dw_index_block_count_out-1.
dw_entrynumberPass in the entry number of the entry of interest. 0 through dw_count_of_index_entries-1.
dw_offset_in_debug_infoOn success set to the offset in .debug_info relevant to this entry.
dw_name_stringOn success set to the size in bytes, in .debug_info, of the area this block refersto.
dw_flagbyteOn success set to the entry flag byte content.
dw_staticorglobalOn success set to the entry static/global letter.
dw_typeofentryOn success set to the type of entry.
dw_errorOn error dw_error is set to point to the error details.
Returns
Returns DW_DLV_OK, DW_DLV_NO_ENTRY (if the section does not exist or is empty), or, in case of an error reading the section, DW_DLV_ERROR.