// dwarf.h -- DWARF2 constants -*- C++ -*-
-// Copyright 2006, 2007, Free Software Foundation, Inc.
+// Copyright (C) 2006-2019 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
-
+
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public License
// as published by the Free Software Foundation; either version 2, or
// DWARF2 codes.
-enum DW_TAG
-{
- DW_TAG_padding = 0x00,
- DW_TAG_array_type = 0x01,
- DW_TAG_class_type = 0x02,
- DW_TAG_entry_point = 0x03,
- DW_TAG_enumeration_type = 0x04,
- DW_TAG_formal_parameter = 0x05,
- DW_TAG_imported_declaration = 0x08,
- DW_TAG_label = 0x0a,
- DW_TAG_lexical_block = 0x0b,
- DW_TAG_member = 0x0d,
- DW_TAG_pointer_type = 0x0f,
- DW_TAG_reference_type = 0x10,
- DW_TAG_compile_unit = 0x11,
- DW_TAG_string_type = 0x12,
- DW_TAG_structure_type = 0x13,
- DW_TAG_subroutine_type = 0x15,
- DW_TAG_typedef = 0x16,
- DW_TAG_union_type = 0x17,
- DW_TAG_unspecified_parameters = 0x18,
- DW_TAG_variant = 0x19,
- DW_TAG_common_block = 0x1a,
- DW_TAG_common_inclusion = 0x1b,
- DW_TAG_inheritance = 0x1c,
- DW_TAG_inlined_subroutine = 0x1d,
- DW_TAG_module = 0x1e,
- DW_TAG_ptr_to_member_type = 0x1f,
- DW_TAG_set_type = 0x20,
- DW_TAG_subrange_type = 0x21,
- DW_TAG_with_stmt = 0x22,
- DW_TAG_access_declaration = 0x23,
- DW_TAG_base_type = 0x24,
- DW_TAG_catch_block = 0x25,
- DW_TAG_const_type = 0x26,
- DW_TAG_constant = 0x27,
- DW_TAG_enumerator = 0x28,
- DW_TAG_file_type = 0x29,
- DW_TAG_friend = 0x2a,
- DW_TAG_namelist = 0x2b,
- DW_TAG_namelist_item = 0x2c,
- DW_TAG_packed_type = 0x2d,
- DW_TAG_subprogram = 0x2e,
- DW_TAG_template_type_param = 0x2f,
- DW_TAG_template_value_param = 0x30,
- DW_TAG_thrown_type = 0x31,
- DW_TAG_try_block = 0x32,
- DW_TAG_variant_part = 0x33,
- DW_TAG_variable = 0x34,
- DW_TAG_volatile_type = 0x35,
-
- // DWARF3.
- DW_TAG_dwarf_procedure = 0x36,
- DW_TAG_restrict_type = 0x37,
- DW_TAG_interface_type = 0x38,
- DW_TAG_namespace = 0x39,
- DW_TAG_imported_module = 0x3a,
- DW_TAG_unspecified_type = 0x3b,
- DW_TAG_partial_unit = 0x3c,
- DW_TAG_imported_unit = 0x3d,
- DW_TAG_condition = 0x3f,
- DW_TAG_shared_type = 0x40,
-
- // SGI/MIPS extensions.
- DW_TAG_MIPS_loop = 0x4081,
+// Include DW_TAG, DW_FORM, DW_AT, DW_OP, DW_ATE, and DW_CFA
+// codes from dwarf2.def.
- // HP extensions.
- // See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz.
- DW_TAG_HP_array_descriptor = 0x4090,
-
- // GNU extensions.
- DW_TAG_format_label = 0x4101, // For FORTRAN 77 and Fortran 90.
- DW_TAG_function_template = 0x4102, // For C++.
- DW_TAG_class_template = 0x4103, // For C++.
- DW_TAG_GNU_BINCL = 0x4104,
- DW_TAG_GNU_EINCL = 0x4105,
-
- // Extensions for UPC. See: http://upc.gwu.edu/~upc.
- DW_TAG_upc_shared_type = 0x8765,
- DW_TAG_upc_strict_type = 0x8766,
- DW_TAG_upc_relaxed_type = 0x8767,
-
- // PGI (STMicroelectronics) extensions. No documentation available.
- DW_TAG_PGI_kanji_type = 0xA000,
- DW_TAG_PGI_interface_block = 0xA020
-};
+#define DW_FIRST_TAG(name, value) enum DW_TAG { \
+ name = value
+#define DW_TAG(name, value) , name = value
+#define DW_TAG_DUP(name, value) , name = value
+#define DW_END_TAG };
+
+#define DW_FIRST_FORM(name, value) enum DW_FORM { \
+ name = value
+#define DW_FORM(name, value) , name = value
+#define DW_END_FORM };
+
+#define DW_FIRST_AT(name, value) enum DW_AT { \
+ name = value
+#define DW_AT(name, value) , name = value
+#define DW_AT_DUP(name, value) , name = value
+#define DW_END_AT };
+
+#define DW_FIRST_OP(name, value) enum DW_OP { \
+ name = value
+#define DW_OP(name, value) , name = value
+#define DW_OP_DUP(name, value) , name = value
+#define DW_END_OP };
+
+#define DW_FIRST_ATE(name, value) enum DW_ENCODING { \
+ name = value
+#define DW_ATE(name, value) , name = value
+#define DW_ATE_DUP(name, value) , name = value
+#define DW_END_ATE };
+
+#define DW_FIRST_CFA(name, value) enum DW_CFA { \
+ name = value
+#define DW_CFA(name, value) , name = value
+#define DW_CFA_DUP(name, value) , name = value
+#define DW_END_CFA };
+
+#define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \
+ name = value
+#define DW_IDX(name, value) , name = value
+#define DW_IDX_DUP(name, value) , name = value
+#define DW_END_IDX };
+
+#include "dwarf2.def"
+
+#undef DW_FIRST_TAG
+#undef DW_TAG
+#undef DW_TAG_DUP
+#undef DW_END_TAG
+
+#undef DW_FIRST_FORM
+#undef DW_FORM
+#undef DW_END_FORM
+
+#undef DW_FIRST_AT
+#undef DW_AT
+#undef DW_AT_DUP
+#undef DW_END_AT
+
+#undef DW_FIRST_OP
+#undef DW_OP
+#undef DW_OP_DUP
+#undef DW_END_OP
+
+#undef DW_FIRST_ATE
+#undef DW_ATE
+#undef DW_ATE_DUP
+#undef DW_END_ATE
+
+#undef DW_FIRST_CFA
+#undef DW_CFA_DUP
+#undef DW_CFA
+#undef DW_END_CFA
+
+#undef DW_FIRST_IDX
+#undef DW_IDX
+#undef DW_IDX_DUP
+#undef DW_END_IDX
// Frame unwind information.
DW_EH_PE_indirect = 0x80
};
+// Line number opcodes.
+
+enum DW_LINE_OPS
+{
+ DW_LNS_extended_op = 0,
+ DW_LNS_copy = 1,
+ DW_LNS_advance_pc = 2,
+ DW_LNS_advance_line = 3,
+ DW_LNS_set_file = 4,
+ DW_LNS_set_column = 5,
+ DW_LNS_negate_stmt = 6,
+ DW_LNS_set_basic_block = 7,
+ DW_LNS_const_add_pc = 8,
+ DW_LNS_fixed_advance_pc = 9,
+ // DWARF 3.
+ DW_LNS_set_prologue_end = 10,
+ DW_LNS_set_epilogue_begin = 11,
+ DW_LNS_set_isa = 12
+};
+
+// Line number extended opcodes.
+
+enum DW_LINE_EXTENDED_OPS
+{
+ DW_LNE_end_sequence = 1,
+ DW_LNE_set_address = 2,
+ DW_LNE_define_file = 3,
+ // DWARF4.
+ DW_LNE_set_discriminator = 4,
+ // HP extensions.
+ DW_LNE_HP_negate_is_UV_update = 0x11,
+ DW_LNE_HP_push_context = 0x12,
+ DW_LNE_HP_pop_context = 0x13,
+ DW_LNE_HP_set_file_line_column = 0x14,
+ DW_LNE_HP_set_routine_name = 0x15,
+ DW_LNE_HP_set_sequence = 0x16,
+ DW_LNE_HP_negate_post_semantics = 0x17,
+ DW_LNE_HP_negate_function_exit = 0x18,
+ DW_LNE_HP_negate_front_end_logical = 0x19,
+ DW_LNE_HP_define_proc = 0x20
+};
+
+enum DW_CHILDREN
+{
+ DW_CHILDREN_no =0x00,
+ DW_CHILDREN_yes =0x01
+};
+
+// Source language names and codes.
+enum DW_LANG
+{
+ DW_LANG_C89 = 0x0001,
+ DW_LANG_C = 0x0002,
+ DW_LANG_Ada83 = 0x0003,
+ DW_LANG_C_plus_plus = 0x0004,
+ DW_LANG_Cobol74 = 0x0005,
+ DW_LANG_Cobol85 = 0x0006,
+ DW_LANG_Fortran77 = 0x0007,
+ DW_LANG_Fortran90 = 0x0008,
+ DW_LANG_Pascal83 = 0x0009,
+ DW_LANG_Modula2 = 0x000a,
+ // DWARF 3.
+ DW_LANG_Java = 0x000b,
+ DW_LANG_C99 = 0x000c,
+ DW_LANG_Ada95 = 0x000d,
+ DW_LANG_Fortran95 = 0x000e,
+ DW_LANG_PLI = 0x000f,
+ DW_LANG_ObjC = 0x0010,
+ DW_LANG_ObjC_plus_plus = 0x0011,
+ DW_LANG_UPC = 0x0012,
+ DW_LANG_D = 0x0013,
+ // DWARF 4.
+ DW_LANG_Python = 0x0014,
+ // DWARF 5.
+ DW_LANG_Go = 0x0016,
+ DW_LANG_C_plus_plus_11 = 0x001a,
+ DW_LANG_C11 = 0x001d,
+ DW_LANG_C_plus_plus_14 = 0x0021,
+ DW_LANG_Fortran03 = 0x0022,
+ DW_LANG_Fortran08 = 0x0023,
+
+ DW_LANG_lo_user = 0x8000, // Implementation-defined range start.
+ DW_LANG_hi_user = 0xffff, // Implementation-defined range start.
+ // MIPS.
+ DW_LANG_Mips_Assembler = 0x8001,
+ // UPC.
+ DW_LANG_Upc = 0x8765,
+ // HP extensions.
+ DW_LANG_HP_Bliss = 0x8003,
+ DW_LANG_HP_Basic91 = 0x8004,
+ DW_LANG_HP_Pascal91 = 0x8005,
+ DW_LANG_HP_IMacro = 0x8006,
+ DW_LANG_HP_Assembler = 0x8007
+};
+
+// DWARF section identifiers used in the package format.
+// Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP.
+
+enum DW_SECT
+{
+ DW_SECT_INFO = 1,
+ DW_SECT_TYPES = 2,
+ DW_SECT_ABBREV = 3,
+ DW_SECT_LINE = 4,
+ DW_SECT_LOC = 5,
+ DW_SECT_STR_OFFSETS = 6,
+ DW_SECT_MACINFO = 7,
+ DW_SECT_MACRO = 8,
+ DW_SECT_MAX = DW_SECT_MACRO,
+};
+
} // End namespace elfcpp.
#endif // !defined(ELFCPP_DWARF_H)