tools/elf4rom/libs/dwarf-20071209/libdwarf/cmplrs/dwarf_addr_finder.h
changeset 34 92d87f2e53c2
equal deleted inserted replaced
33:1af5c1be89f8 34:92d87f2e53c2
       
     1 /*
       
     2    dwarf_addr_finder.h
       
     3    $Source: /plroot/cmplrs.src/v7.4.5m/.RCS/PL/include/cmplrs/RCS/dwarf_addr_finder.h,v $
       
     4    $Date: 2002/06/11 17:49:06 $
       
     5 
       
     6    Defines user interface.
       
     7 
       
     8 */
       
     9 
       
    10 /* return codes for functions
       
    11 */
       
    12 #define DW_DLV_NO_ENTRY -1
       
    13 #define DW_DLV_OK        0
       
    14 #define DW_DLV_ERROR     1
       
    15 
       
    16 
       
    17 /* the following are the 'section' number passed to the called-back
       
    18    function.
       
    19    The called-back application must translate this to the 
       
    20    appropriate elf section number/pointer.
       
    21 
       
    22    Putting this burden on the application avoids having to store
       
    23    the numbers in the Dwarf_Debug structure (thereby saving space
       
    24    for most consumers).
       
    25 */
       
    26 #define DW_SECTION_INFO      0
       
    27 #define DW_SECTION_FRAME     1
       
    28 #define DW_SECTION_ARANGES   2
       
    29 #define DW_SECTION_LINE      3
       
    30 #define DW_SECTION_LOC       4  /* .debug_loc */
       
    31 
       
    32 /* section is one of the above codes: it specifies a section.
       
    33    secoff is the offset in the dwarf section.
       
    34    existingAddr is the value at the specified offset (so the
       
    35 	called back routine can sanity check the proceedings).
       
    36    It's up to the caller to know the size of an address (4 or 8)
       
    37    and update the right number of bytes.
       
    38 */
       
    39 typedef int (*Dwarf_addr_callback_func)   (int /*section*/, 
       
    40         Dwarf_Off /*secoff*/, Dwarf_Addr /*existingAddr*/);
       
    41 
       
    42 /* call this to do the work: it calls back thru cb_func
       
    43    once per each address to be modified.
       
    44    Once this returns you are done.
       
    45    Returns DW_DLV_OK if finished ok.
       
    46    Returns DW_DLV_ERROR if there was some kind of error, in which
       
    47 	the dwarf error number was passed back thu the dwerr ptr.
       
    48    Returns DW_DLV_NO_ENTRY if there are no relevant dwarf sections,
       
    49 	so there were no addresses to be modified (and none
       
    50 	called back).
       
    51 */
       
    52 int _dwarf_addr_finder(dwarf_elf_handle elf_file_ptr,
       
    53                 Dwarf_addr_callback_func cb_func,
       
    54                 int *dwerr);
       
    55