home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / libdwarf / dwarf_line.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.5 KB  |  118 lines

  1. /*
  2.     dwarf_line.h
  3.  
  4.     Defines the opaque structures used only by dwarf_line.c
  5.     and pro_line.c
  6.  
  7.     $Revision: 1.13 $ $Date: 1994/06/06 20:12:26 $
  8. */
  9.  
  10. #define DW_EXTENDED_OPCODE    0
  11.  
  12. /*
  13.     This is used as the starting value for an algorithm
  14.     to get the minimum difference between 2 values.
  15.     UINT_MAX is used as our approximation to infinity.
  16. */
  17. #define MAX_LINE_DIFF       UINT_MAX
  18.  
  19.  
  20. /*
  21.     This structure is used to build a list of all the
  22.     files that are used in the current compilation unit.
  23.     All of the fields execpt fi_next have meanings that
  24.     are obvious from section 6.2.4 of the Libdwarf Doc.
  25. */
  26. struct Dwarf_File_Entry_s {
  27.         /* Points to string naming the file. */
  28.     Dwarf_Small                *fi_file_name;
  29.  
  30.         /* 
  31.             Index into the list of directories of 
  32.             the directory in which this file exits.
  33.         */
  34.     Dwarf_Sword              fi_dir_index;
  35.  
  36.         /* Time of last modification of the file. */
  37.     Dwarf_Unsigned              fi_time_last_mod;
  38.  
  39.         /* Length in bytes of the file. */
  40.     Dwarf_Unsigned              fi_file_length;
  41.  
  42.         /* Pointer for chaining file entries. */
  43.     Dwarf_File_Entry            fi_next;
  44. };
  45.  
  46.  
  47. typedef struct Dwarf_Line_Context_s     *Dwarf_Line_Context;
  48.  
  49. /* 
  50.     This structure provides the context in which the fields of 
  51.     a Dwarf_Line structure are interpreted.  They come from the 
  52.     statement program prologue.  **Updated by dwarf_srclines in 
  53.     dwarf_line.c.
  54. */
  55. struct Dwarf_Line_Context_s {
  56.     /*
  57.         Points to a chain of entries providing info
  58.         about source files for the current set of
  59.         Dwarf_Line structures.
  60.     */
  61.     Dwarf_File_Entry    lc_file_entries;
  62.     /*  
  63.         Count of number of source files for this set of
  64.         Dwarf_Line structures. 
  65.     */
  66.     Dwarf_Sword          lc_file_entry_count;
  67.     /* 
  68.         Points to the portion of .debug_line section
  69.         that contains a list of strings naming the
  70.         included directories.
  71.     */
  72.     Dwarf_Small         *lc_include_directories;
  73.  
  74.     /* Count of the number of included directories. */
  75.     Dwarf_Sword          lc_include_directories_count;
  76.  
  77.     /* Count of the number of lines for this cu. */
  78.     Dwarf_Sword        lc_line_count;
  79.  
  80.     /* Points to name of compilation directory. */
  81.     Dwarf_Small        *lc_compilation_directory;
  82.  
  83.     Dwarf_Debug        lc_dbg;
  84. };
  85.  
  86.  
  87. /*
  88.     This structure defines a row of the line table.
  89.     All of the fields except li_dbg have the exact 
  90.     same meaning that is defined in Section 6.2.2 
  91.     of the Libdwarf Document.
  92. */
  93. struct Dwarf_Line_s {
  94.    Dwarf_Addr              li_address;         /* pc value of machine instr */
  95.    union addr_or_line_s {
  96.      struct li_inner_s {
  97.       Dwarf_Sword             li_file;          /* int identifying src file */
  98.       Dwarf_Sword             li_line;          /* source file line number. */
  99.       Dwarf_Half              li_column;        /* source file column number */
  100.       Dwarf_Small             li_is_stmt;       /* indicate start of stmt */
  101.       Dwarf_Small             li_basic_block;   /* indicate start basic block */
  102.       Dwarf_Small             li_end_sequence;  /* first post sequence instr */
  103.      }li_l_data;
  104.      Dwarf_Off                li_offset;        /* for rqs */
  105.    } li_addr_line;
  106.    Dwarf_Line_Context      li_context;         /* assoc Dwarf_Line_Context_s */
  107. };
  108.  
  109.  
  110. int
  111. _dwarf_line_address_offsets(Dwarf_Debug dbg,
  112.                 Dwarf_Die die,
  113.                 Dwarf_Addr **addrs,
  114.                 Dwarf_Off  **offs,
  115.                 Dwarf_Unsigned *returncount,
  116.                 Dwarf_Error *err);
  117.  
  118.