1 // dwarf.h -- DWARF2 constants -*- C++ -*-
3 // Copyright (C) 2006-2019 Free Software Foundation, Inc.
4 // Written by Ian Lance Taylor <iant@google.com>.
6 // This file is part of elfcpp.
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public License
10 // as published by the Free Software Foundation; either version 2, or
11 // (at your option) any later version.
13 // In addition to the permissions in the GNU Library General Public
14 // License, the Free Software Foundation gives you unlimited
15 // permission to link the compiled version of this file into
16 // combinations with other programs, and to distribute those
17 // combinations without any restriction coming from the use of this
18 // file. (The Library Public License restrictions do apply in other
19 // respects; for example, they cover modification of the file, and
20 /// distribution when not linked into a combined executable.)
22 // This program is distributed in the hope that it will be useful, but
23 // WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 // Library General Public License for more details.
27 // You should have received a copy of the GNU Library General Public
28 // License along with this program; if not, write to the Free Software
29 // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
32 #ifndef ELFCPP_DWARF_H
33 #define ELFCPP_DWARF_H
40 // Include DW_TAG, DW_FORM, DW_AT, DW_OP, DW_ATE, and DW_CFA
41 // codes from dwarf2.def.
43 #define DW_FIRST_TAG(name, value) enum DW_TAG { \
45 #define DW_TAG(name, value) , name = value
46 #define DW_TAG_DUP(name, value) , name = value
49 #define DW_FIRST_FORM(name, value) enum DW_FORM { \
51 #define DW_FORM(name, value) , name = value
52 #define DW_END_FORM };
54 #define DW_FIRST_AT(name, value) enum DW_AT { \
56 #define DW_AT(name, value) , name = value
57 #define DW_AT_DUP(name, value) , name = value
60 #define DW_FIRST_OP(name, value) enum DW_OP { \
62 #define DW_OP(name, value) , name = value
63 #define DW_OP_DUP(name, value) , name = value
66 #define DW_FIRST_ATE(name, value) enum DW_ENCODING { \
68 #define DW_ATE(name, value) , name = value
69 #define DW_ATE_DUP(name, value) , name = value
72 #define DW_FIRST_CFA(name, value) enum DW_CFA { \
74 #define DW_CFA(name, value) , name = value
75 #define DW_CFA_DUP(name, value) , name = value
78 #define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \
80 #define DW_IDX(name, value) , name = value
81 #define DW_IDX_DUP(name, value) , name = value
120 // Frame unwind information.
124 DW_EH_PE_absptr
= 0x00,
125 DW_EH_PE_omit
= 0xff,
127 DW_EH_PE_uleb128
= 0x01,
128 DW_EH_PE_udata2
= 0x02,
129 DW_EH_PE_udata4
= 0x03,
130 DW_EH_PE_udata8
= 0x04,
131 DW_EH_PE_signed
= 0x08,
132 DW_EH_PE_sleb128
= 0x09,
133 DW_EH_PE_sdata2
= 0x0a,
134 DW_EH_PE_sdata4
= 0x0b,
135 DW_EH_PE_sdata8
= 0x0c,
137 DW_EH_PE_pcrel
= 0x10,
138 DW_EH_PE_textrel
= 0x20,
139 DW_EH_PE_datarel
= 0x30,
140 DW_EH_PE_funcrel
= 0x40,
141 DW_EH_PE_aligned
= 0x50,
143 DW_EH_PE_indirect
= 0x80
146 // Line number opcodes.
150 DW_LNS_extended_op
= 0,
152 DW_LNS_advance_pc
= 2,
153 DW_LNS_advance_line
= 3,
155 DW_LNS_set_column
= 5,
156 DW_LNS_negate_stmt
= 6,
157 DW_LNS_set_basic_block
= 7,
158 DW_LNS_const_add_pc
= 8,
159 DW_LNS_fixed_advance_pc
= 9,
161 DW_LNS_set_prologue_end
= 10,
162 DW_LNS_set_epilogue_begin
= 11,
166 // Line number extended opcodes.
168 enum DW_LINE_EXTENDED_OPS
170 DW_LNE_end_sequence
= 1,
171 DW_LNE_set_address
= 2,
172 DW_LNE_define_file
= 3,
174 DW_LNE_set_discriminator
= 4,
176 DW_LNE_HP_negate_is_UV_update
= 0x11,
177 DW_LNE_HP_push_context
= 0x12,
178 DW_LNE_HP_pop_context
= 0x13,
179 DW_LNE_HP_set_file_line_column
= 0x14,
180 DW_LNE_HP_set_routine_name
= 0x15,
181 DW_LNE_HP_set_sequence
= 0x16,
182 DW_LNE_HP_negate_post_semantics
= 0x17,
183 DW_LNE_HP_negate_function_exit
= 0x18,
184 DW_LNE_HP_negate_front_end_logical
= 0x19,
185 DW_LNE_HP_define_proc
= 0x20
190 DW_CHILDREN_no
=0x00,
191 DW_CHILDREN_yes
=0x01
194 // Source language names and codes.
197 DW_LANG_C89
= 0x0001,
199 DW_LANG_Ada83
= 0x0003,
200 DW_LANG_C_plus_plus
= 0x0004,
201 DW_LANG_Cobol74
= 0x0005,
202 DW_LANG_Cobol85
= 0x0006,
203 DW_LANG_Fortran77
= 0x0007,
204 DW_LANG_Fortran90
= 0x0008,
205 DW_LANG_Pascal83
= 0x0009,
206 DW_LANG_Modula2
= 0x000a,
208 DW_LANG_Java
= 0x000b,
209 DW_LANG_C99
= 0x000c,
210 DW_LANG_Ada95
= 0x000d,
211 DW_LANG_Fortran95
= 0x000e,
212 DW_LANG_PLI
= 0x000f,
213 DW_LANG_ObjC
= 0x0010,
214 DW_LANG_ObjC_plus_plus
= 0x0011,
215 DW_LANG_UPC
= 0x0012,
218 DW_LANG_Python
= 0x0014,
221 DW_LANG_C_plus_plus_11
= 0x001a,
222 DW_LANG_C11
= 0x001d,
223 DW_LANG_C_plus_plus_14
= 0x0021,
224 DW_LANG_Fortran03
= 0x0022,
225 DW_LANG_Fortran08
= 0x0023,
227 DW_LANG_lo_user
= 0x8000, // Implementation-defined range start.
228 DW_LANG_hi_user
= 0xffff, // Implementation-defined range start.
230 DW_LANG_Mips_Assembler
= 0x8001,
232 DW_LANG_Upc
= 0x8765,
234 DW_LANG_HP_Bliss
= 0x8003,
235 DW_LANG_HP_Basic91
= 0x8004,
236 DW_LANG_HP_Pascal91
= 0x8005,
237 DW_LANG_HP_IMacro
= 0x8006,
238 DW_LANG_HP_Assembler
= 0x8007
241 // DWARF section identifiers used in the package format.
242 // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP.
251 DW_SECT_STR_OFFSETS
= 6,
254 DW_SECT_MAX
= DW_SECT_MACRO
,
257 } // End namespace elfcpp.
259 #endif // !defined(ELFCPP_DWARF_H)