Initial revision
[gcc.git] / gcc / dwarf.h
1 /* Dwarf definitions.
2
3 This file is derived from the DWARF specification, Draft #5 by the UNIX
4 International Programming Languages Special Interest Group dated 10/21/91.
5 */
6
7 /* Tag names and codes: Figure 9. */
8
9 #define TAG_padding 0x0000
10 #define TAG_array_type 0x0001
11 #define TAG_class_type 0x0002
12 #define TAG_entry_point 0x0003
13 #define TAG_enumeration_type 0x0004
14 #define TAG_formal_parameter 0x0005
15 #define TAG_global_subroutine 0x0006
16 #define TAG_global_variable 0x0007
17 #define TAG_imported_declaration 0x0008
18
19 #define TAG_label 0x000a
20 #define TAG_lexical_block 0x000b
21 #define TAG_local_variable 0x000c
22 #define TAG_member 0x000d
23
24 #define TAG_pointer_type 0x000f
25 #define TAG_reference_type 0x0010
26 #define TAG_compile_unit 0x0011
27 #define TAG_source_file 0x0011
28 #define TAG_string_type 0x0012
29 #define TAG_structure_type 0x0013
30 #define TAG_subroutine 0x0014
31 #define TAG_subroutine_type 0x0015
32 #define TAG_typedef 0x0016
33 #define TAG_union_type 0x0017
34 #define TAG_unspecified_parameters 0x0018
35 #define TAG_variant 0x0019
36 #define TAG_common_block 0x001a
37 #define TAG_common_inclusion 0x001b
38 #define TAG_format 0x001c
39 #define TAG_inheritance 0x001d
40 #define TAG_inlined_subroutine 0x001e
41 #define TAG_module 0x001f
42 #define TAG_ptr_to_member_type 0x0020
43 #define TAG_set_type 0x0021
44 #define TAG_subrange_type 0x0022
45 #define TAG_with_stmt 0x0023
46
47 #define TAG_lo_user 0x8000
48 #define TAG_hi_user 0xffff
49
50 /* Form names and codes: Figure 10. */
51
52 #define FORM_ADDR 0x1
53 #define FORM_REF 0x2
54 #define FORM_BLOCK2 0x3
55 #define FORM_BLOCK4 0x4
56 #define FORM_DATA2 0x5
57 #define FORM_DATA4 0x6
58 #define FORM_DATA8 0x7
59 #define FORM_STRING 0x8
60
61 /* Attribute names and codes: Figure 11. */
62
63 #define AT_sibling /* reference */ (0x0010|FORM_REF)
64 #define AT_location /* block2 */ (0x0020|FORM_BLOCK2)
65 #define AT_name /* string */ (0x0030|FORM_STRING)
66 #define AT_fund_type /* halfword */ (0x0050|FORM_DATA2)
67 #define AT_mod_fund_type /* block2 */ (0x0060|FORM_BLOCK2)
68 #define AT_user_def_type /* reference */ (0x0070|FORM_REF)
69 #define AT_mod_u_d_type /* block2 */ (0x0080|FORM_BLOCK2)
70 #define AT_ordering /* halfword */ (0x0090|FORM_DATA2)
71 #define AT_subscr_data /* block2 */ (0x00a0|FORM_BLOCK2)
72 #define AT_byte_size /* word */ (0x00b0|FORM_DATA4)
73 #define AT_bit_offset /* halfword */ (0x00c0|FORM_DATA2)
74 #define AT_bit_size /* word */ (0x00d0|FORM_DATA4)
75
76 #define AT_element_list /* block4 */ (0x00f0|FORM_BLOCK4)
77 #define AT_stmt_list /* word */ (0x0100|FORM_DATA4)
78 #define AT_low_pc /* address */ (0x0110|FORM_ADDR)
79 #define AT_high_pc /* address */ (0x0120|FORM_ADDR)
80 #define AT_language /* word */ (0x0130|FORM_DATA4)
81 #define AT_member /* reference */ (0x0140|FORM_REF)
82 #define AT_discr /* reference */ (0x0150|FORM_REF)
83 #define AT_discr_value /* block2 */ (0x0160|FORM_BLOCK2)
84 #define AT_visibility /* halfword */ (0x0170|FORM_DATA2)
85 #define AT_import /* reference */ (0x0180|FORM_REF)
86 #define AT_string_length /* block2 */ (0x0190|FORM_BLOCK2)
87 #define AT_common_reference /* reference */ (0x01a0|FORM_REF)
88 #define AT_comp_dir /* string */ (0x01b0|FORM_STRING)
89
90 #define AT_const_value_string /* string */ (0x01c0|FORM_STRING)
91 #define AT_const_value_data2 /* halfword */ (0x01c0|FORM_DATA2)
92 #define AT_const_value_data4 /* word */ (0x01c0|FORM_DATA4)
93 #define AT_const_value_data8 /* doubleword */(0x01c0|FORM_DATA8)
94 #define AT_const_value_block2 /* block2 */ (0x01c0|FORM_BLOCK2)
95 #define AT_const_value_block4 /* block4 */ (0x01c0|FORM_BLOCK4)
96
97 #define AT_containing_type /* reference */ (0x01d0|FORM_REF)
98
99 #define AT_default_value_addr /* address */ (0x01e0|FORM_ADDR)
100 #define AT_default_value_data2 /* halfword */ (0x01e0|FORM_DATA2)
101 #define AT_default_value_data4 /* word */ (0x01e0|FORM_DATA4)
102 #define AT_default_value_data8 /* doubleword */(0x01e0|FORM_DATA8)
103 #define AT_default_value_string /* string */ (0x01e0|FORM_STRING)
104
105 #define AT_friends /* block2 */ (0x01f0|FORM_BLOCK2)
106 #define AT_inline /* string */ (0x0200|FORM_STRING)
107 #define AT_is_optional /* string */ (0x0210|FORM_STRING)
108
109 #define AT_lower_bound_ref /* reference */ (0x0220|FORM_REF)
110 #define AT_lower_bound_data2 /* halfword */ (0x0220|FORM_DATA2)
111 #define AT_lower_bound_data4 /* word */ (0x0220|FORM_DATA4)
112 #define AT_lower_bound_data8 /* doubleword */(0x0220|FORM_DATA8)
113
114 #define AT_main_program /* string */ (0x0230|FORM_STRING)
115 #define AT_private /* string */ (0x0240|FORM_STRING)
116 #define AT_producer /* string */ (0x0250|FORM_STRING)
117 #define AT_protected /* string */ (0x0260|FORM_STRING)
118 #define AT_prototyped /* string */ (0x0270|FORM_STRING)
119 #define AT_public /* string */ (0x0280|FORM_STRING)
120 #define AT_pure_virtual /* string */ (0x0290|FORM_STRING)
121 #define AT_return_addr_loc /* block2 */ (0x02a0|FORM_BLOCK2)
122 #define AT_specification /* reference */ (0x02b0|FORM_REF)
123 #define AT_start_scope /* word */ (0x02c0|FORM_DATA4)
124 #define AT_static_link_loc /* block2 */ (0x02d0|FORM_BLOCK2)
125 #define AT_stride_size /* word */ (0x02e0|FORM_DATA4)
126
127 #define AT_upper_bound_ref /* reference */ (0x02f0|FORM_REF)
128 #define AT_upper_bound_data2 /* halfword */ (0x02f0|FORM_DATA2)
129 #define AT_upper_bound_data4 /* word */ (0x02f0|FORM_DATA4)
130 #define AT_upper_bound_data8 /* doubleword */(0x02f0|FORM_DATA8)
131
132 #define AT_virtual /* string */ (0x0300|FORM_STRING)
133 #define AT_frame_base /* block2 */ (0x0310|FORM_BLOCK2)
134
135 /* GNU attribute extensions. */
136
137 #define AT_sf_names /* word */ (0x8000|FORM_DATA4)
138 #define AT_src_info /* word */ (0x8010|FORM_DATA4)
139 #define AT_mac_info /* word */ (0x8020|FORM_DATA4)
140
141 #define AT_lo_user /* - */ 0x8000
142 #define AT_hi_user /* - */ 0xffff
143
144 /* Location atom names and codes: Figure 13. */
145
146 #define OP_REG 0x01
147 #define OP_BASEREG 0x02
148 #define OP_ADDR 0x03
149 #define OP_CONST 0x04
150 #define OP_DEREF2 0x05
151 #define OP_DEREF4 0x06
152 #define OP_ADD 0x07
153
154 #define OP_LO_USER 0x80
155 #define OP_HI_USER 0xff
156
157 /* Fundamental type names and codes: figure 14. */
158
159 #define FT_char 0x0001
160 #define FT_signed_char 0x0002
161 #define FT_unsigned_char 0x0003
162 #define FT_short 0x0004
163 #define FT_signed_short 0x0005
164 #define FT_unsigned_short 0x0006
165 #define FT_integer 0x0007
166 #define FT_signed_integer 0x0008
167 #define FT_unsigned_integer 0x0009
168 #define FT_long 0x000a
169 #define FT_signed_long 0x000b
170 #define FT_unsigned_long 0x000c
171 #define FT_pointer 0x000d
172 #define FT_float 0x000e
173 #define FT_dbl_prec_float 0x000f
174 #define FT_ext_prec_float 0x0010 /* not accepted by "classic" svr4 SDB */
175 #define FT_complex 0x0011 /* not accepted by "classic" svr4 SDB */
176 #define FT_dbl_prec_complex 0x0012 /* not accepted by "classic" svr4 SDB */
177
178 #define FT_void 0x0014
179 #define FT_boolean 0x0015 /* not accepted by "classic" svr4 SDB */
180 #define FT_ext_prec_complex 0x0016 /* not accepted by "classic" svr4 SDB */
181
182 /* GNU-specific fundamental type codes - not accepted by "classic" svr4 SDB */
183
184 #define FT_long_long 0x8000
185 #define FT_signed_long_long 0x8001
186 #define FT_unsigned_long_long 0x8002
187
188 #define FT_lo_user 0x8000
189 #define FT_hi_user 0xffff
190
191 /* Type modifier names and codes: Figure 15. */
192
193 #define MOD_pointer_to 0x01
194 #define MOD_reference_to 0x02
195 #define MOD_const 0x03
196 #define MOD_volatile 0x04
197
198 #define MOD_lo_user 0x80
199 #define MOD_hi_user 0xff
200
201 /* Visibility names and codes: Figure 16. */
202
203 #define VIS_local 0x00
204 #define VIS_exported 0x01
205
206 #define VIS_lo_user 0x80
207 #define VIS_hi_user 0xff
208
209 /* Array ordering names and codes: Figure 18. */
210
211 #define ORD_row_major 0
212 #define ORD_col_major 1
213
214 /* Array subscript format names and codes: Figure 19. */
215
216 #define FMT_FT_C_C 0x0
217 #define FMT_FT_C_X 0x1
218 #define FMT_FT_X_C 0x2
219 #define FMT_FT_X_X 0x3
220 #define FMT_UT_C_C 0x4
221 #define FMT_UT_C_X 0x5
222 #define FMT_UT_X_C 0x6
223 #define FMT_UT_X_X 0x7
224 #define FMT_ET 0x8
225
226 /* Derived from above for ease of use. */
227
228 #define FMT_CODE(_FUNDAMENTAL_TYPE_P, _UB_CONST_P, _LB_CONST_P) \
229 (((_FUNDAMENTAL_TYPE_P) ? 0 : 4) \
230 | ((_UB_CONST_P) ? 0 : 2) \
231 | ((_LB_CONST_P) ? 0 : 1))
232
233 /* Source language names and codes: Figure 17. */
234
235 #define LANG_C89 0x0001
236 #define LANG_C 0x0002
237 #define LANG_ADA83 0x0003
238 #define LANG_C_PLUS_PLUS 0x0004
239 #define LANG_COBOL74 0x0005
240 #define LANG_COBOL85 0x0006
241 #define LANG_FORTRAN77 0x0007
242 #define LANG_FORTRAN90 0x0008
243 #define LANG_PASCAL83 0x0009
244 #define LANG_MODULA2 0x000a
245
246 #define LANG_LO_USER 0x8000
247 #define LANG_HI_USER 0xffff
248
249 /* Names and codes for GNU "macinfo" extension. */
250
251 #define MACINFO_start 's'
252 #define MACINFO_resume 'r'
253 #define MACINFO_define 'd'
254 #define MACINFO_undef 'u'