home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Dwarf.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  6.8 KB  |  202 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __DWARF_H
  7. #define __DWARF_H 1
  8.  
  9. /* dwarf.h - defines used in the .debug section of ELF files */
  10.  
  11. #define    TAG_padding            0x0000
  12. #define    TAG_array_type            0x0001
  13. #define    TAG_class_type            0x0002
  14. #define    TAG_entry_point            0x0003
  15. #define    TAG_enumeration_type        0x0004
  16. #define    TAG_formal_parameter        0x0005
  17. #define    TAG_global_subroutine        0x0006
  18. #define    TAG_global_variable        0x0007
  19. #define    TAG_label            0x000a
  20. #define    TAG_lexical_block        0x000b
  21. #define    TAG_local_variable        0x000c
  22. #define    TAG_member            0x000d
  23. #define    TAG_pointer_type        0x000f
  24. #define    TAG_reference_type        0x0010
  25. #define    TAG_compile_unit        0x0011
  26. #define    TAG_string_type            0x0012
  27. #define    TAG_structure_type        0x0013
  28. #define    TAG_subroutine            0x0014
  29. #define    TAG_subroutine_type        0x0015
  30. #define TAG_typedef            0x0016
  31. #define    TAG_union_type            0x0017
  32. #define    TAG_unspecified_parameters    0x0018
  33. #define    TAG_variant            0x0019
  34. #define    TAG_common_block        0x001a
  35. #define    TAG_common_inclusion        0x001b
  36. #define    TAG_inheritance            0x001c
  37. #define    TAG_inlined_subroutine        0x001d
  38. #define    TAG_module            0x001e
  39. #define    TAG_ptr_to_member_type        0x001f
  40. #define    TAG_set_type            0x0020
  41. #define    TAG_subrange_type        0x0021
  42. #define    TAG_with_stmt            0x0022
  43. #define TAG_NUM             0x0023
  44. #define    TAG_lo_user            0x8000
  45. #define    TAG_hi_user            0xffff
  46.  
  47. #define TAG_source_file            TAG_compile_unit
  48.  
  49. #define    FORM_MASK    0xf
  50. #define DWARF_AT(word)         (word & ~FORM_MASK)
  51. #define DWARF_FORM(word)     (word & FORM_MASK)
  52.  
  53. #define FORM_NONE       0x0
  54. #define FORM_ADDR       0x1
  55. #define FORM_REF        0x2
  56. #define FORM_BLOCK2     0x3
  57. #define FORM_BLOCK4     0x4
  58. #define FORM_DATA2      0x5
  59. #define FORM_DATA4      0x6
  60. #define FORM_DATA8      0x7
  61. #define FORM_STRING     0x8
  62.  
  63.  
  64. #define AT_padding              (0x0000|FORM_NONE)
  65. #define AT_sibling              (0x0010|FORM_REF)
  66. #define AT_location             (0x0020|FORM_BLOCK2)
  67. #define AT_name                 (0x0030|FORM_STRING)
  68. #define AT_fund_type            (0x0050|FORM_DATA2)
  69. #define AT_mod_fund_type        (0x0060|FORM_BLOCK2)
  70. #define AT_user_def_type        (0x0070|FORM_REF)
  71. #define AT_mod_u_d_type         (0x0080|FORM_BLOCK2)
  72. #define AT_ordering             (0x0090|FORM_DATA2)
  73. #define AT_subscr_data          (0x00a0|FORM_BLOCK2)
  74. #define AT_byte_size            (0x00b0|FORM_DATA4)
  75. #define AT_bit_offset           (0x00c0|FORM_DATA2)
  76. #define AT_bit_size             (0x00d0|FORM_DATA4)
  77. #define AT_element_list         (0x00f0|FORM_BLOCK4)
  78. #define AT_stmt_list            (0x0100|FORM_DATA4)
  79. #define AT_low_pc               (0x0110|FORM_ADDR)
  80. #define AT_high_pc              (0x0120|FORM_ADDR)
  81. #define AT_language             (0x0130|FORM_DATA4)
  82. #define AT_member               (0x0140|FORM_REF)
  83. #define AT_discr                (0x0150|FORM_REF)
  84. #define AT_discr_value          (0x0160|FORM_BLOCK2)
  85. #define AT_string_length        (0x0190|FORM_BLOCK2)
  86. #define AT_common_reference     (0x01a0|FORM_REF)
  87. #define AT_comp_dir             (0x01b0|FORM_STRING)
  88. #define AT_const_value          0x01c0
  89. #define AT_containing_type      (0x01d0|FORM_REF)
  90. #define AT_default_value        0x01e0
  91. #define AT_friends              (0x01f0|FORM_BLOCK2)
  92. #define AT_inline               (0x0200|FORM_STRING)
  93. #define AT_is_optional          (0x0210|FORM_STRING)
  94. #define AT_lower_bound          0x0220
  95. #define AT_program              (0x0230|FORM_STRING)
  96. #define AT_private              (0x0240|FORM_STRING)
  97. #define AT_producer             (0x0250|FORM_STRING)
  98. #define AT_protected            (0x0260|FORM_STRING)
  99. #define AT_prototyped           (0x0270|FORM_STRING)
  100. #define AT_public               (0x0280|FORM_STRING)
  101. #define AT_pure_virtual         (0x0290|FORM_STRING)
  102. #define AT_return_addr          (0x02a0|FORM_BLOCK2)
  103. #define AT_specification        (0x02b0|FORM_REF)
  104. #define AT_start_scope          (0x02c0|FORM_DATA4)
  105. #define AT_stride_size          (0x02e0|FORM_DATA4)
  106. #define AT_upper_bound          0x02f0
  107. #define AT_virtual              (0x0300|FORM_STRING)
  108. #define AT_NUM            0x0031
  109. #define    AT_lo_user        0x2000
  110. #define    AT_hi_user         0x3ff0
  111.  
  112. #define OP_UNK          0x00
  113. #define OP_REG          0x01
  114. #define OP_BASEREG      0x02
  115. #define OP_ADDR         0x03
  116. #define OP_CONST        0x04
  117. #define OP_DEREF2       0x05
  118. #define OP_DEREF        0x06
  119. #define OP_ADD          0x07
  120. #define OP_NUM        0x08
  121.  
  122. #define OP_DEREF4    OP_DEREF
  123.  
  124. #define FT_none                 0x0000
  125. #define FT_char                 0x0001
  126. #define    FT_signed_char        0x0002
  127. #define    FT_unsigned_char    0x0003
  128. #define FT_short                0x0004
  129. #define    FT_signed_short        0x0005
  130. #define    FT_unsigned_short    0x0006
  131. #define FT_integer              0x0007
  132. #define    FT_signed_integer    0x0008
  133. #define    FT_unsigned_integer    0x0009
  134. #define FT_long                 0x000a
  135. #define    FT_signed_long        0x000b
  136. #define    FT_unsigned_long    0x000c
  137. #define FT_pointer              0x000d
  138. #define    FT_float        0x000e
  139. #define    FT_dbl_prec_float    0x000f
  140. #define    FT_ext_prec_float    0x0010
  141. #define    FT_complex        0x0011
  142. #define    FT_dbl_prec_complex    0x0012
  143. #define    FT_void            0x0014
  144. #define    FT_boolean        0x0015
  145. #define    FT_ext_prec_complex    0x0016
  146. #define    FT_label        0x0017
  147. #define FT_NUM            0x0018
  148. #define    FT_lo_user        0x8000
  149. #define    FT_hi_user        0xffff
  150.  
  151. #define MOD_none                0x00
  152. #define    MOD_pointer_to        0x01
  153. #define    MOD_reference_to    0x02
  154. #define    MOD_const        0x03
  155. #define    MOD_volatile        0x04
  156. #define MOD_NUM            0x05
  157. #define    MOD_lo_user        0x80
  158. #define    MOD_hi_user        0xff
  159.  
  160. #define FMT_FT                  0
  161. #define FMT_UDT                 1
  162.  
  163. #define FMT_CONST               0
  164. #define FMT_EXPR                1
  165.  
  166. #define FMT_FT_C_C              ( (FMT_FT <<2) | (FMT_CONST<<1) | (FMT_CONST) )
  167. #define FMT_FT_C_X              ( (FMT_FT <<2) | (FMT_CONST<<1) | (FMT_EXPR)  )
  168. #define FMT_FT_X_C              ( (FMT_FT <<2) | (FMT_EXPR <<1) | (FMT_CONST) )
  169. #define FMT_FT_X_X              ( (FMT_FT <<2) | (FMT_EXPR <<1) | (FMT_EXPR)  )
  170. #define FMT_UT_C_C              ( (FMT_UDT<<2) | (FMT_CONST<<1) | (FMT_CONST) )
  171. #define FMT_UT_C_X              ( (FMT_UDT<<2) | (FMT_CONST<<1) | (FMT_EXPR)  )
  172. #define FMT_UT_X_C              ( (FMT_UDT<<2) | (FMT_EXPR <<1) | (FMT_CONST) )
  173. #define FMT_UT_X_X              ( (FMT_UDT<<2) | (FMT_EXPR <<1) | (FMT_EXPR)  )
  174.  
  175. #define FMT_ET          8
  176.  
  177. #define    ORD_row_major    0
  178. #define ORD_col_major    1
  179. #define ORD_NUM        2
  180.  
  181. enum LANG {
  182.     LANG_UNK         = 0,
  183.     LANG_C89         = 0x0001,
  184.     LANG_C             = 0x0002,
  185.     LANG_ADA83         = 0x0003,
  186.     LANG_C_PLUS_PLUS     = 0x0004,
  187.     LANG_COBOL74         = 0x0005,
  188.     LANG_COBOL85         = 0x0006,
  189.     LANG_FORTRAN77         = 0x0007,
  190.     LANG_FORTRAN90         = 0x0008,
  191.     LANG_PASCAL83         = 0x0009,
  192.     LANG_MODULA2         = 0x000a,
  193.     LANG_LO_USER        = 0x8000,
  194.     LANG_HI_USER        = 0xffff
  195. };
  196.  
  197. #define LANG_NUM          0x000b
  198.  
  199. #define    LANG_ANSI_C_V1        LANG_C89
  200.  
  201. #endif
  202.