1 /* Declarations and definitions of codes relating to the DWARF symbolic
2 debugging information format.
3 Copyright (C) 1992, 1993, 1995, 1996, 1999 Free Software Foundation, Inc.
5 Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
6 Office (AJPO), Florida State Unviversity and Silicon Graphics Inc.
7 provided support for this effort -- June 21, 1995.
9 Derived from the DWARF 1 implementation written by Ron Guilmette
10 (rfg@netcom.com), November 1990.
12 This file is part of GNU CC.
14 GNU CC is free software; you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by the
16 Free Software Foundation; either version 2, or (at your option) any
19 GNU CC is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 You should have received a copy of the GNU General Public License
25 along with GNU CC; see the file COPYING. If not, write to the Free
26 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
28 /* This file is derived from the DWARF specification (a public document)
29 Revision 2.0.0 (July 27, 1993) developed by the UNIX International
30 Programming Languages Special Interest Group (UI/PLSIG) and distributed
31 by UNIX International. Copies of this specification are available from
32 UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054. */
37 /* Structure found in the .debug_line section. */
40 unsigned char li_length
[4];
41 unsigned char li_version
[2];
42 unsigned char li_prologue_length
[4];
43 unsigned char li_min_insn_length
[1];
44 unsigned char li_default_is_stmt
[1];
45 unsigned char li_line_base
[1];
46 unsigned char li_line_range
[1];
47 unsigned char li_opcode_base
[1];
49 DWARF2_External_LineInfo
;
53 unsigned long li_length
;
54 unsigned short li_version
;
55 unsigned int li_prologue_length
;
56 unsigned char li_min_insn_length
;
57 unsigned char li_default_is_stmt
;
59 unsigned char li_line_range
;
60 unsigned char li_opcode_base
;
62 DWARF2_Internal_LineInfo
;
64 /* Structure found in .debug_pubnames section. */
67 unsigned char pn_length
[4];
68 unsigned char pn_version
[2];
69 unsigned char pn_offset
[4];
70 unsigned char pn_size
[4];
72 DWARF2_External_PubNames
;
76 unsigned long pn_length
;
77 unsigned short pn_version
;
78 unsigned long pn_offset
;
79 unsigned long pn_size
;
81 DWARF2_Internal_PubNames
;
83 /* Strcuture found in .debug_info section. */
86 unsigned char cu_length
[4];
87 unsigned char cu_version
[2];
88 unsigned char cu_abbrev_offset
[4];
89 unsigned char cu_pointer_size
[1];
91 DWARF2_External_CompUnit
;
95 unsigned long cu_length
;
96 unsigned short cu_version
;
97 unsigned long cu_abbrev_offset
;
98 unsigned char cu_pointer_size
;
100 DWARF2_Internal_CompUnit
;
103 /* Tag names and codes. */
107 DW_TAG_padding
= 0x00,
108 DW_TAG_array_type
= 0x01,
109 DW_TAG_class_type
= 0x02,
110 DW_TAG_entry_point
= 0x03,
111 DW_TAG_enumeration_type
= 0x04,
112 DW_TAG_formal_parameter
= 0x05,
113 DW_TAG_imported_declaration
= 0x08,
115 DW_TAG_lexical_block
= 0x0b,
116 DW_TAG_member
= 0x0d,
117 DW_TAG_pointer_type
= 0x0f,
118 DW_TAG_reference_type
= 0x10,
119 DW_TAG_compile_unit
= 0x11,
120 DW_TAG_string_type
= 0x12,
121 DW_TAG_structure_type
= 0x13,
122 DW_TAG_subroutine_type
= 0x15,
123 DW_TAG_typedef
= 0x16,
124 DW_TAG_union_type
= 0x17,
125 DW_TAG_unspecified_parameters
= 0x18,
126 DW_TAG_variant
= 0x19,
127 DW_TAG_common_block
= 0x1a,
128 DW_TAG_common_inclusion
= 0x1b,
129 DW_TAG_inheritance
= 0x1c,
130 DW_TAG_inlined_subroutine
= 0x1d,
131 DW_TAG_module
= 0x1e,
132 DW_TAG_ptr_to_member_type
= 0x1f,
133 DW_TAG_set_type
= 0x20,
134 DW_TAG_subrange_type
= 0x21,
135 DW_TAG_with_stmt
= 0x22,
136 DW_TAG_access_declaration
= 0x23,
137 DW_TAG_base_type
= 0x24,
138 DW_TAG_catch_block
= 0x25,
139 DW_TAG_const_type
= 0x26,
140 DW_TAG_constant
= 0x27,
141 DW_TAG_enumerator
= 0x28,
142 DW_TAG_file_type
= 0x29,
143 DW_TAG_friend
= 0x2a,
144 DW_TAG_namelist
= 0x2b,
145 DW_TAG_namelist_item
= 0x2c,
146 DW_TAG_packed_type
= 0x2d,
147 DW_TAG_subprogram
= 0x2e,
148 DW_TAG_template_type_param
= 0x2f,
149 DW_TAG_template_value_param
= 0x30,
150 DW_TAG_thrown_type
= 0x31,
151 DW_TAG_try_block
= 0x32,
152 DW_TAG_variant_part
= 0x33,
153 DW_TAG_variable
= 0x34,
154 DW_TAG_volatile_type
= 0x35,
155 /* SGI/MIPS Extensions */
156 DW_TAG_MIPS_loop
= 0x4081,
158 DW_TAG_format_label
= 0x4101, /* for FORTRAN 77 and Fortran 90 */
159 DW_TAG_function_template
= 0x4102, /* for C++ */
160 DW_TAG_class_template
= 0x4103 /* for C++ */
163 #define DW_TAG_lo_user 0x4080
164 #define DW_TAG_hi_user 0xffff
166 /* flag that tells whether entry has a child or not */
167 #define DW_children_no 0
168 #define DW_children_yes 1
170 /* Form names and codes. */
174 DW_FORM_block2
= 0x03,
175 DW_FORM_block4
= 0x04,
176 DW_FORM_data2
= 0x05,
177 DW_FORM_data4
= 0x06,
178 DW_FORM_data8
= 0x07,
179 DW_FORM_string
= 0x08,
180 DW_FORM_block
= 0x09,
181 DW_FORM_block1
= 0x0a,
182 DW_FORM_data1
= 0x0b,
184 DW_FORM_sdata
= 0x0d,
186 DW_FORM_udata
= 0x0f,
187 DW_FORM_ref_addr
= 0x10,
192 DW_FORM_ref_udata
= 0x15,
193 DW_FORM_indirect
= 0x16
196 /* Attribute names and codes. */
200 DW_AT_sibling
= 0x01,
201 DW_AT_location
= 0x02,
203 DW_AT_ordering
= 0x09,
204 DW_AT_subscr_data
= 0x0a,
205 DW_AT_byte_size
= 0x0b,
206 DW_AT_bit_offset
= 0x0c,
207 DW_AT_bit_size
= 0x0d,
208 DW_AT_element_list
= 0x0f,
209 DW_AT_stmt_list
= 0x10,
211 DW_AT_high_pc
= 0x12,
212 DW_AT_language
= 0x13,
215 DW_AT_discr_value
= 0x16,
216 DW_AT_visibility
= 0x17,
218 DW_AT_string_length
= 0x19,
219 DW_AT_common_reference
= 0x1a,
220 DW_AT_comp_dir
= 0x1b,
221 DW_AT_const_value
= 0x1c,
222 DW_AT_containing_type
= 0x1d,
223 DW_AT_default_value
= 0x1e,
225 DW_AT_is_optional
= 0x21,
226 DW_AT_lower_bound
= 0x22,
227 DW_AT_producer
= 0x25,
228 DW_AT_prototyped
= 0x27,
229 DW_AT_return_addr
= 0x2a,
230 DW_AT_start_scope
= 0x2c,
231 DW_AT_stride_size
= 0x2e,
232 DW_AT_upper_bound
= 0x2f,
233 DW_AT_abstract_origin
= 0x31,
234 DW_AT_accessibility
= 0x32,
235 DW_AT_address_class
= 0x33,
236 DW_AT_artificial
= 0x34,
237 DW_AT_base_types
= 0x35,
238 DW_AT_calling_convention
= 0x36,
240 DW_AT_data_member_location
= 0x38,
241 DW_AT_decl_column
= 0x39,
242 DW_AT_decl_file
= 0x3a,
243 DW_AT_decl_line
= 0x3b,
244 DW_AT_declaration
= 0x3c,
245 DW_AT_discr_list
= 0x3d,
246 DW_AT_encoding
= 0x3e,
247 DW_AT_external
= 0x3f,
248 DW_AT_frame_base
= 0x40,
250 DW_AT_identifier_case
= 0x42,
251 DW_AT_macro_info
= 0x43,
252 DW_AT_namelist_items
= 0x44,
253 DW_AT_priority
= 0x45,
254 DW_AT_segment
= 0x46,
255 DW_AT_specification
= 0x47,
256 DW_AT_static_link
= 0x48,
258 DW_AT_use_location
= 0x4a,
259 DW_AT_variable_parameter
= 0x4b,
260 DW_AT_virtuality
= 0x4c,
261 DW_AT_vtable_elem_location
= 0x4d,
262 /* SGI/MIPS Extensions */
263 DW_AT_MIPS_fde
= 0x2001,
264 DW_AT_MIPS_loop_begin
= 0x2002,
265 DW_AT_MIPS_tail_loop_begin
= 0x2003,
266 DW_AT_MIPS_epilog_begin
= 0x2004,
267 DW_AT_MIPS_loop_unroll_factor
= 0x2005,
268 DW_AT_MIPS_software_pipeline_depth
= 0x2006,
269 DW_AT_MIPS_linkage_name
= 0x2007,
270 DW_AT_MIPS_stride
= 0x2008,
271 DW_AT_MIPS_abstract_name
= 0x2009,
272 DW_AT_MIPS_clone_origin
= 0x200a,
273 DW_AT_MIPS_has_inlines
= 0x200b,
274 /* GNU extensions. */
275 DW_AT_sf_names
= 0x2101,
276 DW_AT_src_info
= 0x2102,
277 DW_AT_mac_info
= 0x2103,
278 DW_AT_src_coords
= 0x2104,
279 DW_AT_body_begin
= 0x2105,
280 DW_AT_body_end
= 0x2106
283 #define DW_AT_lo_user 0x2000 /* implementation-defined range start */
284 #define DW_AT_hi_user 0x3ff0 /* implementation-defined range end */
286 /* Location atom names and codes. */
288 enum dwarf_location_atom
292 DW_OP_const1u
= 0x08,
293 DW_OP_const1s
= 0x09,
294 DW_OP_const2u
= 0x0a,
295 DW_OP_const2s
= 0x0b,
296 DW_OP_const4u
= 0x0c,
297 DW_OP_const4s
= 0x0d,
298 DW_OP_const8u
= 0x0e,
299 DW_OP_const8s
= 0x0f,
319 DW_OP_plus_uconst
= 0x23,
432 DW_OP_deref_size
= 0x94,
433 DW_OP_xderef_size
= 0x95,
437 #define DW_OP_lo_user 0x80 /* implementation-defined range start */
438 #define DW_OP_hi_user 0xff /* implementation-defined range end */
440 /* Type encodings. */
445 DW_ATE_address
= 0x1,
446 DW_ATE_boolean
= 0x2,
447 DW_ATE_complex_float
= 0x3,
450 DW_ATE_signed_char
= 0x6,
451 DW_ATE_unsigned
= 0x7,
452 DW_ATE_unsigned_char
= 0x8
455 #define DW_ATE_lo_user 0x80
456 #define DW_ATE_hi_user 0xff
458 /* Array ordering names and codes. */
459 enum dwarf_array_dim_ordering
461 DW_ORD_row_major
= 0,
465 /* access attribute */
466 enum dwarf_access_attribute
468 DW_ACCESS_public
= 1,
469 DW_ACCESS_protected
= 2,
470 DW_ACCESS_private
= 3
474 enum dwarf_visibility_attribute
482 enum dwarf_virtuality_attribute
484 DW_VIRTUALITY_none
= 0,
485 DW_VIRTUALITY_virtual
= 1,
486 DW_VIRTUALITY_pure_virtual
= 2
489 /* case sensitivity */
492 DW_ID_case_sensitive
= 0,
495 DW_ID_case_insensitive
= 3
498 /* calling convention */
499 enum dwarf_calling_convention
506 #define DW_CC_lo_user 0x40
507 #define DW_CC_hi_user 0xff
509 /* inline attribute */
510 enum dwarf_inline_attribute
512 DW_INL_not_inlined
= 0,
514 DW_INL_declared_not_inlined
= 2,
515 DW_INL_declared_inlined
= 3
518 /* descriminant lists */
519 enum dwarf_descrim_list
525 /* line number opcodes */
526 enum dwarf_line_number_ops
528 DW_LNS_extended_op
= 0,
530 DW_LNS_advance_pc
= 2,
531 DW_LNS_advance_line
= 3,
533 DW_LNS_set_column
= 5,
534 DW_LNS_negate_stmt
= 6,
535 DW_LNS_set_basic_block
= 7,
536 DW_LNS_const_add_pc
= 8,
537 DW_LNS_fixed_advance_pc
= 9
540 /* line number extended opcodes */
541 enum dwarf_line_number_x_ops
543 DW_LNE_end_sequence
= 1,
544 DW_LNE_set_address
= 2,
545 DW_LNE_define_file
= 3
548 /* call frame information */
549 enum dwarf_call_frame_info
551 DW_CFA_advance_loc
= 0x40,
552 DW_CFA_offset
= 0x80,
553 DW_CFA_restore
= 0xc0,
555 DW_CFA_set_loc
= 0x01,
556 DW_CFA_advance_loc1
= 0x02,
557 DW_CFA_advance_loc2
= 0x03,
558 DW_CFA_advance_loc4
= 0x04,
559 DW_CFA_offset_extended
= 0x05,
560 DW_CFA_restore_extended
= 0x06,
561 DW_CFA_undefined
= 0x07,
562 DW_CFA_same_value
= 0x08,
563 DW_CFA_register
= 0x09,
564 DW_CFA_remember_state
= 0x0a,
565 DW_CFA_restore_state
= 0x0b,
566 DW_CFA_def_cfa
= 0x0c,
567 DW_CFA_def_cfa_register
= 0x0d,
568 DW_CFA_def_cfa_offset
= 0x0e,
569 /* SGI/MIPS specific */
570 DW_CFA_MIPS_advance_loc8
= 0x1d
573 #define DW_CIE_ID 0xffffffff
574 #define DW_CIE_VERSION 1
576 #define DW_CFA_extended 0
577 #define DW_CFA_low_user 0x1c
578 #define DW_CFA_high_user 0x3f
580 #define DW_CHILDREN_no 0x00
581 #define DW_CHILDREN_yes 0x01
583 #define DW_ADDR_none 0
585 /* Source language names and codes. */
587 enum dwarf_source_language
589 DW_LANG_C89
= 0x0001,
591 DW_LANG_Ada83
= 0x0003,
592 DW_LANG_C_plus_plus
= 0x0004,
593 DW_LANG_Cobol74
= 0x0005,
594 DW_LANG_Cobol85
= 0x0006,
595 DW_LANG_Fortran77
= 0x0007,
596 DW_LANG_Fortran90
= 0x0008,
597 DW_LANG_Pascal83
= 0x0009,
598 DW_LANG_Modula2
= 0x000a,
599 DW_LANG_Mips_Assembler
= 0x8001
603 #define DW_LANG_lo_user 0x8000 /* implementation-defined range start */
604 #define DW_LANG_hi_user 0xffff /* implementation-defined range start */
606 /* Names and codes for macro information. */
608 enum dwarf_macinfo_record_type
610 DW_MACINFO_define
= 1,
611 DW_MACINFO_undef
= 2,
612 DW_MACINFO_start_file
= 3,
613 DW_MACINFO_end_file
= 4,
614 DW_MACINFO_vendor_ext
= 255
617 #endif /* _ELF_DWARF2_H */