1 // dwarf.h -- DWARF2 constants -*- C++ -*- 2 3 // Copyright (C) 2006-2014 Free Software Foundation, Inc. 4 // Written by Ian Lance Taylor <iant@google.com>. 5 6 // This file is part of elfcpp. 7 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. 12 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.) 21 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. 26 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 30 // 02110-1301, USA. 31 32 #ifndef ELFCPP_DWARF_H 33 #define ELFCPP_DWARF_H 34 35 namespace elfcpp 36 { 37 38 // DWARF2 codes. 39 40 // Include DW_TAG, DW_FORM, DW_AT, DW_OP, DW_ATE, and DW_CFA 41 // codes from dwarf2.def. 42 43 #define DW_FIRST_TAG(name, value) enum DW_TAG { \ 44 name = value 45 #define DW_TAG(name, value) , name = value 46 #define DW_TAG_DUP(name, value) , name = value 47 #define DW_END_TAG }; 48 49 #define DW_FIRST_FORM(name, value) enum DW_FORM { \ 50 name = value 51 #define DW_FORM(name, value) , name = value 52 #define DW_END_FORM }; 53 54 #define DW_FIRST_AT(name, value) enum DW_AT { \ 55 name = value 56 #define DW_AT(name, value) , name = value 57 #define DW_AT_DUP(name, value) , name = value 58 #define DW_END_AT }; 59 60 #define DW_FIRST_OP(name, value) enum DW_OP { \ 61 name = value 62 #define DW_OP(name, value) , name = value 63 #define DW_OP_DUP(name, value) , name = value 64 #define DW_END_OP }; 65 66 #define DW_FIRST_ATE(name, value) enum DW_ENCODING { \ 67 name = value 68 #define DW_ATE(name, value) , name = value 69 #define DW_ATE_DUP(name, value) , name = value 70 #define DW_END_ATE }; 71 72 #define DW_FIRST_CFA(name, value) enum DW_CFA { \ 73 name = value 74 #define DW_CFA(name, value) , name = value 75 #define DW_END_CFA }; 76 77 #include "dwarf2.def" 78 79 #undef DW_FIRST_TAG 80 #undef DW_TAG 81 #undef DW_TAG_DUP 82 #undef DW_END_TAG 83 84 #undef DW_FIRST_FORM 85 #undef DW_FORM 86 #undef DW_END_FORM 87 88 #undef DW_FIRST_AT 89 #undef DW_AT 90 #undef DW_AT_DUP 91 #undef DW_END_AT 92 93 #undef DW_FIRST_OP 94 #undef DW_OP 95 #undef DW_OP_DUP 96 #undef DW_END_OP 97 98 #undef DW_FIRST_ATE 99 #undef DW_ATE 100 #undef DW_ATE_DUP 101 #undef DW_END_ATE 102 103 #undef DW_FIRST_CFA 104 #undef DW_CFA 105 #undef DW_END_CFA 106 107 // Frame unwind information. 108 109 enum DW_EH_PE 110 { 111 DW_EH_PE_absptr = 0x00, 112 DW_EH_PE_omit = 0xff, 113 114 DW_EH_PE_uleb128 = 0x01, 115 DW_EH_PE_udata2 = 0x02, 116 DW_EH_PE_udata4 = 0x03, 117 DW_EH_PE_udata8 = 0x04, 118 DW_EH_PE_signed = 0x08, 119 DW_EH_PE_sleb128 = 0x09, 120 DW_EH_PE_sdata2 = 0x0a, 121 DW_EH_PE_sdata4 = 0x0b, 122 DW_EH_PE_sdata8 = 0x0c, 123 124 DW_EH_PE_pcrel = 0x10, 125 DW_EH_PE_textrel = 0x20, 126 DW_EH_PE_datarel = 0x30, 127 DW_EH_PE_funcrel = 0x40, 128 DW_EH_PE_aligned = 0x50, 129 130 DW_EH_PE_indirect = 0x80 131 }; 132 133 // Line number opcodes. 134 135 enum DW_LINE_OPS 136 { 137 DW_LNS_extended_op = 0, 138 DW_LNS_copy = 1, 139 DW_LNS_advance_pc = 2, 140 DW_LNS_advance_line = 3, 141 DW_LNS_set_file = 4, 142 DW_LNS_set_column = 5, 143 DW_LNS_negate_stmt = 6, 144 DW_LNS_set_basic_block = 7, 145 DW_LNS_const_add_pc = 8, 146 DW_LNS_fixed_advance_pc = 9, 147 // DWARF 3. 148 DW_LNS_set_prologue_end = 10, 149 DW_LNS_set_epilogue_begin = 11, 150 DW_LNS_set_isa = 12, 151 /* Experimental DWARF 5 extensions. 152 See http://wiki.dwarfstd.org/index.php?title=TwoLevelLineTables. */ 153 DW_LNS_set_address_from_logical = 13, /* Actuals table only. */ 154 DW_LNS_set_subprogram = 13, /* Logicals table only. */ 155 DW_LNS_inlined_call = 14, /* Logicals table only. */ 156 DW_LNS_pop_context = 15 /* Logicals table only. */ 157 }; 158 159 // Line number extended opcodes. 160 161 enum DW_LINE_EXTENDED_OPS 162 { 163 DW_LNE_end_sequence = 1, 164 DW_LNE_set_address = 2, 165 DW_LNE_define_file = 3, 166 // DWARF4. 167 DW_LNE_set_discriminator = 4, 168 // HP extensions. 169 DW_LNE_HP_negate_is_UV_update = 0x11, 170 DW_LNE_HP_push_context = 0x12, 171 DW_LNE_HP_pop_context = 0x13, 172 DW_LNE_HP_set_file_line_column = 0x14, 173 DW_LNE_HP_set_routine_name = 0x15, 174 DW_LNE_HP_set_sequence = 0x16, 175 DW_LNE_HP_negate_post_semantics = 0x17, 176 DW_LNE_HP_negate_function_exit = 0x18, 177 DW_LNE_HP_negate_front_end_logical = 0x19, 178 DW_LNE_HP_define_proc = 0x20 179 }; 180 181 enum DW_CHILDREN 182 { 183 DW_CHILDREN_no =0x00, 184 DW_CHILDREN_yes =0x01 185 }; 186 187 // Source language names and codes. 188 enum DW_LANG 189 { 190 DW_LANG_C89 = 0x0001, 191 DW_LANG_C = 0x0002, 192 DW_LANG_Ada83 = 0x0003, 193 DW_LANG_C_plus_plus = 0x0004, 194 DW_LANG_Cobol74 = 0x0005, 195 DW_LANG_Cobol85 = 0x0006, 196 DW_LANG_Fortran77 = 0x0007, 197 DW_LANG_Fortran90 = 0x0008, 198 DW_LANG_Pascal83 = 0x0009, 199 DW_LANG_Modula2 = 0x000a, 200 // DWARF 3. 201 DW_LANG_Java = 0x000b, 202 DW_LANG_C99 = 0x000c, 203 DW_LANG_Ada95 = 0x000d, 204 DW_LANG_Fortran95 = 0x000e, 205 DW_LANG_PLI = 0x000f, 206 DW_LANG_ObjC = 0x0010, 207 DW_LANG_ObjC_plus_plus = 0x0011, 208 DW_LANG_UPC = 0x0012, 209 DW_LANG_D = 0x0013, 210 // DWARF 4. 211 DW_LANG_Python = 0x0014, 212 // DWARF 5. 213 DW_LANG_Go = 0x0016, 214 DW_LANG_C_plus_plus_11 = 0x001a, 215 DW_LANG_C11 = 0x001d, 216 DW_LANG_C_plus_plus_14 = 0x0021, 217 DW_LANG_Fortran03 = 0x0022, 218 DW_LANG_Fortran08 = 0x0023, 219 220 DW_LANG_lo_user = 0x8000, // Implementation-defined range start. 221 DW_LANG_hi_user = 0xffff, // Implementation-defined range start. 222 // MIPS. 223 DW_LANG_Mips_Assembler = 0x8001, 224 // UPC. 225 DW_LANG_Upc = 0x8765, 226 // HP extensions. 227 DW_LANG_HP_Bliss = 0x8003, 228 DW_LANG_HP_Basic91 = 0x8004, 229 DW_LANG_HP_Pascal91 = 0x8005, 230 DW_LANG_HP_IMacro = 0x8006, 231 DW_LANG_HP_Assembler = 0x8007 232 }; 233 234 // DWARF section identifiers used in the package format. 235 // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP. 236 237 enum DW_SECT 238 { 239 DW_SECT_INFO = 1, 240 DW_SECT_TYPES = 2, 241 DW_SECT_ABBREV = 3, 242 DW_SECT_LINE = 4, 243 DW_SECT_LOC = 5, 244 DW_SECT_STR_OFFSETS = 6, 245 DW_SECT_MACINFO = 7, 246 DW_SECT_MACRO = 8, 247 DW_SECT_MAX = DW_SECT_MACRO, 248 }; 249 250 enum DW_LNCT 251 { 252 DW_LNCT_path = 1, 253 DW_LNCT_directory_index = 2, 254 DW_LNCT_timestamp = 3, 255 DW_LNCT_size = 4, 256 DW_LNCT_MD5 = 5, 257 /* Experimental DWARF 5 extensions. 258 See http://wiki.dwarfstd.org/index.php?title=TwoLevelLineTables. */ 259 DW_LNCT_subprogram_name = 6, 260 DW_LNCT_decl_file = 7, 261 DW_LNCT_decl_line = 8 262 }; 263 264 } // End namespace elfcpp. 265 266 #endif // !defined(ELFCPP_DWARF_H) 267