]> git.ipfire.org Git - thirdparty/gcc.git/blame - include/dwarf2.h
Sync include/plugin-api.h with binutils.
[thirdparty/gcc.git] / include / dwarf2.h
CommitLineData
0e7a2378 1/* Declarations and definitions of codes relating to the DWARF2 and
2 DWARF3 symbolic debugging information formats.
0215f1b3 3 Copyright (C) 1992-2015 Free Software Foundation, Inc.
6bb7c2f2 4
5 Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
d716ce75 6 Office (AJPO), Florida State University and Silicon Graphics Inc.
6bb7c2f2 7 provided support for this effort -- June 21, 1995.
8
9 Derived from the DWARF 1 implementation written by Ron Guilmette
10 (rfg@netcom.com), November 1990.
30ade641 11
6c54fa79 12 This file is part of GCC.
23a93690 13
6c54fa79 14 GCC is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free
8c4c00c1 16 Software Foundation; either version 3, or (at your option) any later
6c54fa79 17 version.
23a93690 18
6c54fa79 19 GCC is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
22 License for more details.
23a93690 23
6bc9506f 24 Under Section 7 of GPL version 3, you are granted additional
25 permissions described in the GCC Runtime Library Exception, version
26 3.1, as published by the Free Software Foundation.
27
28 You should have received a copy of the GNU General Public License and
29 a copy of the GCC Runtime Library Exception along with this program;
30 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
8c4c00c1 31 <http://www.gnu.org/licenses/>. */
30ade641 32
33/* This file is derived from the DWARF specification (a public document)
34 Revision 2.0.0 (July 27, 1993) developed by the UNIX International
35 Programming Languages Special Interest Group (UI/PLSIG) and distributed
36 by UNIX International. Copies of this specification are available from
6bb7c2f2 37 UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
38
2452254d 39 This file also now contains definitions from the DWARF 3 specification
40 published Dec 20, 2005, available from: http://dwarf.freestandards.org. */
30ade641 41
fbc6ee3a 42#ifndef _DWARF2_H
43#define _DWARF2_H
6c54fa79 44
c9f46599 45#define DW_TAG(name, value) , name = value
46#define DW_TAG_DUP(name, value) , name = value
47#define DW_FORM(name, value) , name = value
48#define DW_AT(name, value) , name = value
49#define DW_AT_DUP(name, value) , name = value
50#define DW_OP(name, value) , name = value
51#define DW_OP_DUP(name, value) , name = value
52#define DW_ATE(name, value) , name = value
53#define DW_ATE_DUP(name, value) , name = value
54#define DW_CFA(name, value) , name = value
55
56#define DW_FIRST_TAG(name, value) enum dwarf_tag { \
57 name = value
58#define DW_END_TAG };
59#define DW_FIRST_FORM(name, value) enum dwarf_form { \
60 name = value
61#define DW_END_FORM };
62#define DW_FIRST_AT(name, value) enum dwarf_attribute { \
63 name = value
64#define DW_END_AT };
65#define DW_FIRST_OP(name, value) enum dwarf_location_atom { \
66 name = value
67#define DW_END_OP };
68#define DW_FIRST_ATE(name, value) enum dwarf_type { \
69 name = value
70#define DW_END_ATE };
71#define DW_FIRST_CFA(name, value) enum dwarf_call_frame_info { \
72 name = value
73#define DW_END_CFA };
74
75#include "dwarf2.def"
76
77#undef DW_FIRST_TAG
78#undef DW_END_TAG
79#undef DW_FIRST_FORM
80#undef DW_END_FORM
81#undef DW_FIRST_AT
82#undef DW_END_AT
83#undef DW_FIRST_OP
84#undef DW_END_OP
85#undef DW_FIRST_ATE
86#undef DW_END_ATE
87#undef DW_FIRST_CFA
88#undef DW_END_CFA
89
90#undef DW_TAG
91#undef DW_TAG_DUP
92#undef DW_FORM
93#undef DW_AT
94#undef DW_AT_DUP
95#undef DW_OP
96#undef DW_OP_DUP
97#undef DW_ATE
98#undef DW_ATE_DUP
99#undef DW_CFA
30ade641 100
6bb7c2f2 101/* Flag that tells whether entry has a child or not. */
30ade641 102#define DW_children_no 0
103#define DW_children_yes 1
104
2452254d 105#define DW_AT_stride_size DW_AT_bit_stride /* Note: The use of DW_AT_stride_size is deprecated. */
2452254d 106#define DW_AT_stride DW_AT_byte_stride /* Note: The use of DW_AT_stride is deprecated. */
30ade641 107
0e7a2378 108/* Decimal sign encodings. */
109enum dwarf_decimal_sign_encoding
110 {
111 /* DWARF 3. */
112 DW_DS_unsigned = 0x01,
113 DW_DS_leading_overpunch = 0x02,
114 DW_DS_trailing_overpunch = 0x03,
115 DW_DS_leading_separate = 0x04,
116 DW_DS_trailing_separate = 0x05
117 };
118
119/* Endianity encodings. */
120enum dwarf_endianity_encoding
121 {
122 /* DWARF 3. */
123 DW_END_default = 0x00,
124 DW_END_big = 0x01,
8458f4ca 125 DW_END_little = 0x02,
0e7a2378 126
8458f4ca 127 DW_END_lo_user = 0x40,
128 DW_END_hi_user = 0xff
129 };
0e7a2378 130
30ade641 131/* Array ordering names and codes. */
132enum dwarf_array_dim_ordering
133 {
134 DW_ORD_row_major = 0,
135 DW_ORD_col_major = 1
136 };
137
6bb7c2f2 138/* Access attribute. */
30ade641 139enum dwarf_access_attribute
140 {
141 DW_ACCESS_public = 1,
142 DW_ACCESS_protected = 2,
143 DW_ACCESS_private = 3
144 };
145
6bb7c2f2 146/* Visibility. */
30ade641 147enum dwarf_visibility_attribute
148 {
149 DW_VIS_local = 1,
150 DW_VIS_exported = 2,
151 DW_VIS_qualified = 3
152 };
153
6bb7c2f2 154/* Virtuality. */
30ade641 155enum dwarf_virtuality_attribute
156 {
157 DW_VIRTUALITY_none = 0,
158 DW_VIRTUALITY_virtual = 1,
159 DW_VIRTUALITY_pure_virtual = 2
160 };
161
6bb7c2f2 162/* Case sensitivity. */
30ade641 163enum dwarf_id_case
164 {
165 DW_ID_case_sensitive = 0,
166 DW_ID_up_case = 1,
167 DW_ID_down_case = 2,
168 DW_ID_case_insensitive = 3
169 };
170
6bb7c2f2 171/* Calling convention. */
30ade641 172enum dwarf_calling_convention
173 {
174 DW_CC_normal = 0x1,
175 DW_CC_program = 0x2,
8ff30ff6 176 DW_CC_nocall = 0x3,
8458f4ca 177
178 DW_CC_lo_user = 0x40,
179 DW_CC_hi_user = 0xff,
180
36ce008e 181 DW_CC_GNU_renesas_sh = 0x40,
fbc6ee3a 182 DW_CC_GNU_borland_fastcall_i386 = 0x41,
183
184 /* This DW_CC_ value is not currently generated by any toolchain. It is
185 used internally to GDB to indicate OpenCL C functions that have been
186 compiled with the IBM XL C for OpenCL compiler and use a non-platform
187 calling convention for passing OpenCL C vector types. This value may
188 be changed freely as long as it does not conflict with any other DW_CC_
189 value defined here. */
190 DW_CC_GDB_IBM_OpenCL = 0xff
30ade641 191 };
192
6bb7c2f2 193/* Inline attribute. */
30ade641 194enum dwarf_inline_attribute
195 {
196 DW_INL_not_inlined = 0,
197 DW_INL_inlined = 1,
198 DW_INL_declared_not_inlined = 2,
199 DW_INL_declared_inlined = 3
200 };
201
6bb7c2f2 202/* Discriminant lists. */
ad87de1e 203enum dwarf_discrim_list
30ade641 204 {
205 DW_DSC_label = 0,
206 DW_DSC_range = 1
207 };
208
6bb7c2f2 209/* Line number opcodes. */
30ade641 210enum dwarf_line_number_ops
211 {
212 DW_LNS_extended_op = 0,
213 DW_LNS_copy = 1,
214 DW_LNS_advance_pc = 2,
215 DW_LNS_advance_line = 3,
216 DW_LNS_set_file = 4,
217 DW_LNS_set_column = 5,
218 DW_LNS_negate_stmt = 6,
219 DW_LNS_set_basic_block = 7,
220 DW_LNS_const_add_pc = 8,
6bb7c2f2 221 DW_LNS_fixed_advance_pc = 9,
222 /* DWARF 3. */
223 DW_LNS_set_prologue_end = 10,
224 DW_LNS_set_epilogue_begin = 11,
225 DW_LNS_set_isa = 12
30ade641 226 };
227
6bb7c2f2 228/* Line number extended opcodes. */
30ade641 229enum dwarf_line_number_x_ops
230 {
231 DW_LNE_end_sequence = 1,
232 DW_LNE_set_address = 2,
6c54fa79 233 DW_LNE_define_file = 3,
2452254d 234 DW_LNE_set_discriminator = 4,
6c54fa79 235 /* HP extensions. */
236 DW_LNE_HP_negate_is_UV_update = 0x11,
237 DW_LNE_HP_push_context = 0x12,
238 DW_LNE_HP_pop_context = 0x13,
239 DW_LNE_HP_set_file_line_column = 0x14,
240 DW_LNE_HP_set_routine_name = 0x15,
241 DW_LNE_HP_set_sequence = 0x16,
242 DW_LNE_HP_negate_post_semantics = 0x17,
243 DW_LNE_HP_negate_function_exit = 0x18,
244 DW_LNE_HP_negate_front_end_logical = 0x19,
8458f4ca 245 DW_LNE_HP_define_proc = 0x20,
3e00a9d3 246 DW_LNE_HP_source_file_correlation = 0x80,
30ade641 247
8458f4ca 248 DW_LNE_lo_user = 0x80,
249 DW_LNE_hi_user = 0xff
250 };
0e7a2378 251
3e8b7d36 252/* Sub-opcodes for DW_LNE_HP_source_file_correlation. */
253enum dwarf_line_number_hp_sfc_ops
254 {
255 DW_LNE_HP_SFC_formfeed = 1,
256 DW_LNE_HP_SFC_set_listing_line = 2,
257 DW_LNE_HP_SFC_associate = 3
258 };
259
b35329c7 260/* Type codes for location list entries.
261 Extension for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
262
263enum dwarf_location_list_entry_type
264 {
265 DW_LLE_GNU_end_of_list_entry = 0,
266 DW_LLE_GNU_base_address_selection_entry = 1,
267 DW_LLE_GNU_start_end_entry = 2,
268 DW_LLE_GNU_start_length_entry = 3
269 };
270
30ade641 271#define DW_CIE_ID 0xffffffff
04da8de9 272#define DW64_CIE_ID 0xffffffffffffffffULL
2452254d 273#define DW_CIE_VERSION 1
30ade641 274
275#define DW_CFA_extended 0
30ade641 276
30ade641 277#define DW_CHILDREN_no 0x00
278#define DW_CHILDREN_yes 0x01
279
280#define DW_ADDR_none 0
281
282/* Source language names and codes. */
30ade641 283enum dwarf_source_language
284 {
285 DW_LANG_C89 = 0x0001,
286 DW_LANG_C = 0x0002,
287 DW_LANG_Ada83 = 0x0003,
288 DW_LANG_C_plus_plus = 0x0004,
289 DW_LANG_Cobol74 = 0x0005,
290 DW_LANG_Cobol85 = 0x0006,
291 DW_LANG_Fortran77 = 0x0007,
292 DW_LANG_Fortran90 = 0x0008,
293 DW_LANG_Pascal83 = 0x0009,
294 DW_LANG_Modula2 = 0x000a,
6bb7c2f2 295 /* DWARF 3. */
0e7a2378 296 DW_LANG_Java = 0x000b,
2e81730a 297 DW_LANG_C99 = 0x000c,
298 DW_LANG_Ada95 = 0x000d,
299 DW_LANG_Fortran95 = 0x000e,
0e7a2378 300 DW_LANG_PLI = 0x000f,
301 DW_LANG_ObjC = 0x0010,
302 DW_LANG_ObjC_plus_plus = 0x0011,
303 DW_LANG_UPC = 0x0012,
304 DW_LANG_D = 0x0013,
711a4686 305 /* DWARF 4. */
4b9ed140 306 DW_LANG_Python = 0x0014,
46c5c275 307 /* DWARF 5. */
308 DW_LANG_Go = 0x0016,
8458f4ca 309
b4721d74 310 DW_LANG_C_plus_plus_11 = 0x001a, /* dwarf5.20141029.pdf DRAFT */
311 DW_LANG_C11 = 0x001d,
312 DW_LANG_C_plus_plus_14 = 0x0021,
f36f9b8b 313 DW_LANG_Fortran03 = 0x0022,
314 DW_LANG_Fortran08 = 0x0023,
b4721d74 315
8458f4ca 316 DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
317 DW_LANG_hi_user = 0xffff, /* Implementation-defined range start. */
318
6bb7c2f2 319 /* MIPS. */
6c54fa79 320 DW_LANG_Mips_Assembler = 0x8001,
321 /* UPC. */
3e00a9d3 322 DW_LANG_Upc = 0x8765,
323 /* HP extensions. */
324 DW_LANG_HP_Bliss = 0x8003,
325 DW_LANG_HP_Basic91 = 0x8004,
326 DW_LANG_HP_Pascal91 = 0x8005,
327 DW_LANG_HP_IMacro = 0x8006,
328 DW_LANG_HP_Assembler = 0x8007
30ade641 329 };
330
212538c2 331/* Names and codes for macro information. */
30ade641 332enum dwarf_macinfo_record_type
333 {
334 DW_MACINFO_define = 1,
335 DW_MACINFO_undef = 2,
336 DW_MACINFO_start_file = 3,
337 DW_MACINFO_end_file = 4,
212538c2 338 DW_MACINFO_vendor_ext = 255
30ade641 339 };
60699ecd 340
341/* Names and codes for new style macro information. */
342enum dwarf_macro_record_type
343 {
344 DW_MACRO_GNU_define = 1,
345 DW_MACRO_GNU_undef = 2,
346 DW_MACRO_GNU_start_file = 3,
347 DW_MACRO_GNU_end_file = 4,
348 DW_MACRO_GNU_define_indirect = 5,
349 DW_MACRO_GNU_undef_indirect = 6,
350 DW_MACRO_GNU_transparent_include = 7,
8122f4a2 351 /* Extensions for DWZ multifile.
352 See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */
d233e0db 353 DW_MACRO_GNU_define_indirect_alt = 8,
354 DW_MACRO_GNU_undef_indirect_alt = 9,
355 DW_MACRO_GNU_transparent_include_alt = 10,
60699ecd 356 DW_MACRO_GNU_lo_user = 0xe0,
357 DW_MACRO_GNU_hi_user = 0xff
358 };
df4b504c 359\f
360/* @@@ For use with GNU frame unwind information. */
361
362#define DW_EH_PE_absptr 0x00
363#define DW_EH_PE_omit 0xff
364
365#define DW_EH_PE_uleb128 0x01
366#define DW_EH_PE_udata2 0x02
367#define DW_EH_PE_udata4 0x03
368#define DW_EH_PE_udata8 0x04
369#define DW_EH_PE_sleb128 0x09
370#define DW_EH_PE_sdata2 0x0A
371#define DW_EH_PE_sdata4 0x0B
372#define DW_EH_PE_sdata8 0x0C
373#define DW_EH_PE_signed 0x08
374
375#define DW_EH_PE_pcrel 0x10
376#define DW_EH_PE_textrel 0x20
377#define DW_EH_PE_datarel 0x30
378#define DW_EH_PE_funcrel 0x40
9a4d22ba 379#define DW_EH_PE_aligned 0x50
df4b504c 380
381#define DW_EH_PE_indirect 0x80
817adc77 382
e82adc39 383/* Codes for the debug sections in a dwarf package (.dwp) file.
384 Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP. */
385enum dwarf_sect
386 {
387 DW_SECT_INFO = 1,
388 DW_SECT_TYPES = 2,
389 DW_SECT_ABBREV = 3,
390 DW_SECT_LINE = 4,
391 DW_SECT_LOC = 5,
392 DW_SECT_STR_OFFSETS = 6,
393 DW_SECT_MACINFO = 7,
394 DW_SECT_MACRO = 8,
395 DW_SECT_MAX = 8
396 };
c9f46599 397
8fd919b6 398#ifdef __cplusplus
399extern "C" {
400#endif /* __cplusplus */
401
c9f46599 402/* Return the name of a DW_TAG_ constant, or NULL if the value is not
403 recognized. */
404extern const char *get_DW_TAG_name (unsigned int tag);
405
406/* Return the name of a DW_AT_ constant, or NULL if the value is not
407 recognized. */
408extern const char *get_DW_AT_name (unsigned int attr);
409
410/* Return the name of a DW_FORM_ constant, or NULL if the value is not
411 recognized. */
412extern const char *get_DW_FORM_name (unsigned int form);
413
414/* Return the name of a DW_OP_ constant, or NULL if the value is not
415 recognized. */
416extern const char *get_DW_OP_name (unsigned int op);
417
418/* Return the name of a DW_ATE_ constant, or NULL if the value is not
419 recognized. */
420extern const char *get_DW_ATE_name (unsigned int enc);
421
422/* Return the name of a DW_CFA_ constant, or NULL if the value is not
423 recognized. */
424extern const char *get_DW_CFA_name (unsigned int opc);
425
8fd919b6 426#ifdef __cplusplus
427}
428#endif /* __cplusplus */
429
fbc6ee3a 430#endif /* _DWARF2_H */