xref: /netbsd-src/external/gpl3/gdb/dist/include/dwarf2.h (revision e663ba6e3a60083e70de702e9d54bf486a57b6a7)
198b9484cSchristos /* Declarations and definitions of codes relating to the DWARF2 and
298b9484cSchristos    DWARF3 symbolic debugging information formats.
3*e663ba6eSchristos    Copyright (C) 1992-2024 Free Software Foundation, Inc.
498b9484cSchristos 
598b9484cSchristos    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
698b9484cSchristos    Office (AJPO), Florida State University and Silicon Graphics Inc.
798b9484cSchristos    provided support for this effort -- June 21, 1995.
898b9484cSchristos 
998b9484cSchristos    Derived from the DWARF 1 implementation written by Ron Guilmette
1098b9484cSchristos    (rfg@netcom.com), November 1990.
1198b9484cSchristos 
1298b9484cSchristos    This file is part of GCC.
1398b9484cSchristos 
1498b9484cSchristos    GCC is free software; you can redistribute it and/or modify it under
1598b9484cSchristos    the terms of the GNU General Public License as published by the Free
1698b9484cSchristos    Software Foundation; either version 3, or (at your option) any later
1798b9484cSchristos    version.
1898b9484cSchristos 
1998b9484cSchristos    GCC is distributed in the hope that it will be useful, but WITHOUT
2098b9484cSchristos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2198b9484cSchristos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
2298b9484cSchristos    License for more details.
2398b9484cSchristos 
2498b9484cSchristos    Under Section 7 of GPL version 3, you are granted additional
2598b9484cSchristos    permissions described in the GCC Runtime Library Exception, version
2698b9484cSchristos    3.1, as published by the Free Software Foundation.
2798b9484cSchristos 
2898b9484cSchristos    You should have received a copy of the GNU General Public License and
2998b9484cSchristos    a copy of the GCC Runtime Library Exception along with this program;
3098b9484cSchristos    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
3198b9484cSchristos    <http://www.gnu.org/licenses/>.  */
3298b9484cSchristos 
3398b9484cSchristos /* This file is derived from the DWARF specification (a public document)
3498b9484cSchristos    Revision 2.0.0 (July 27, 1993) developed by the UNIX International
3598b9484cSchristos    Programming Languages Special Interest Group (UI/PLSIG) and distributed
3698b9484cSchristos    by UNIX International.  Copies of this specification are available from
3798b9484cSchristos    UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
3898b9484cSchristos 
3998b9484cSchristos    This file also now contains definitions from the DWARF 3 specification
4098b9484cSchristos    published Dec 20, 2005, available from: http://dwarf.freestandards.org.  */
4198b9484cSchristos 
4298b9484cSchristos #ifndef _DWARF2_H
4398b9484cSchristos #define _DWARF2_H
4498b9484cSchristos 
45a2e2270fSchristos #define DW_TAG(name, value) , name = value
46a2e2270fSchristos #define DW_TAG_DUP(name, value) , name = value
47a2e2270fSchristos #define DW_FORM(name, value) , name = value
48a2e2270fSchristos #define DW_AT(name, value) , name = value
49a2e2270fSchristos #define DW_AT_DUP(name, value) , name = value
50a2e2270fSchristos #define DW_OP(name, value) , name = value
51a2e2270fSchristos #define DW_OP_DUP(name, value) , name = value
52a2e2270fSchristos #define DW_ATE(name, value) , name = value
53a2e2270fSchristos #define DW_ATE_DUP(name, value) , name = value
54a2e2270fSchristos #define DW_CFA(name, value) , name = value
554559860eSchristos #define DW_CFA_DUP(name, value) , name = value
564559860eSchristos #define DW_IDX(name, value) , name = value
574559860eSchristos #define DW_IDX_DUP(name, value) , name = value
584b169a6bSchristos #define DW_UT(name, value) , name = value
5998b9484cSchristos 
60a2e2270fSchristos #define DW_FIRST_TAG(name, value) enum dwarf_tag { \
61a2e2270fSchristos   name = value
62a2e2270fSchristos #define DW_END_TAG };
63a2e2270fSchristos #define DW_FIRST_FORM(name, value) enum dwarf_form { \
64a2e2270fSchristos   name = value
65a2e2270fSchristos #define DW_END_FORM };
66a2e2270fSchristos #define DW_FIRST_AT(name, value) enum dwarf_attribute { \
67a2e2270fSchristos   name = value
68a2e2270fSchristos #define DW_END_AT };
69a2e2270fSchristos #define DW_FIRST_OP(name, value) enum dwarf_location_atom { \
70a2e2270fSchristos   name = value
71a2e2270fSchristos #define DW_END_OP };
72a2e2270fSchristos #define DW_FIRST_ATE(name, value) enum dwarf_type { \
73a2e2270fSchristos   name = value
74a2e2270fSchristos #define DW_END_ATE };
75a2e2270fSchristos #define DW_FIRST_CFA(name, value) enum dwarf_call_frame_info { \
76a2e2270fSchristos   name = value
77a2e2270fSchristos #define DW_END_CFA };
784559860eSchristos #define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \
794559860eSchristos   name = value
804559860eSchristos #define DW_END_IDX };
814b169a6bSchristos #define DW_FIRST_UT(name, value) enum dwarf_unit_type { \
824b169a6bSchristos   name = value
834b169a6bSchristos #define DW_END_UT };
8498b9484cSchristos 
85a2e2270fSchristos #include "dwarf2.def"
8698b9484cSchristos 
87a2e2270fSchristos #undef DW_FIRST_TAG
88a2e2270fSchristos #undef DW_END_TAG
89a2e2270fSchristos #undef DW_FIRST_FORM
90a2e2270fSchristos #undef DW_END_FORM
91a2e2270fSchristos #undef DW_FIRST_AT
92a2e2270fSchristos #undef DW_END_AT
93a2e2270fSchristos #undef DW_FIRST_OP
94a2e2270fSchristos #undef DW_END_OP
95a2e2270fSchristos #undef DW_FIRST_ATE
96a2e2270fSchristos #undef DW_END_ATE
97a2e2270fSchristos #undef DW_FIRST_CFA
98a2e2270fSchristos #undef DW_END_CFA
994559860eSchristos #undef DW_FIRST_IDX
1004559860eSchristos #undef DW_END_IDX
1014b169a6bSchristos #undef DW_FIRST_UT
1024b169a6bSchristos #undef DW_END_UT
10398b9484cSchristos 
104a2e2270fSchristos #undef DW_TAG
105a2e2270fSchristos #undef DW_TAG_DUP
106a2e2270fSchristos #undef DW_FORM
107a2e2270fSchristos #undef DW_AT
108a2e2270fSchristos #undef DW_AT_DUP
109a2e2270fSchristos #undef DW_OP
110a2e2270fSchristos #undef DW_OP_DUP
111a2e2270fSchristos #undef DW_ATE
112a2e2270fSchristos #undef DW_ATE_DUP
113a2e2270fSchristos #undef DW_CFA
1144559860eSchristos #undef DW_CFA_DUP
1154559860eSchristos #undef DW_IDX
1164559860eSchristos #undef DW_IDX_DUP
1174b169a6bSchristos #undef DW_UT
11898b9484cSchristos 
11998b9484cSchristos /* Flag that tells whether entry has a child or not.  */
12098b9484cSchristos #define DW_children_no   0
12198b9484cSchristos #define	DW_children_yes  1
12298b9484cSchristos 
12398b9484cSchristos #define DW_AT_stride_size   DW_AT_bit_stride  /* Note: The use of DW_AT_stride_size is deprecated.  */
12498b9484cSchristos #define DW_AT_stride   DW_AT_byte_stride  /* Note: The use of DW_AT_stride is deprecated.  */
12598b9484cSchristos 
12698b9484cSchristos /* Decimal sign encodings.  */
12798b9484cSchristos enum dwarf_decimal_sign_encoding
12898b9484cSchristos   {
12998b9484cSchristos     /* DWARF 3.  */
13098b9484cSchristos     DW_DS_unsigned = 0x01,
13198b9484cSchristos     DW_DS_leading_overpunch = 0x02,
13298b9484cSchristos     DW_DS_trailing_overpunch = 0x03,
13398b9484cSchristos     DW_DS_leading_separate = 0x04,
13498b9484cSchristos     DW_DS_trailing_separate = 0x05
13598b9484cSchristos   };
13698b9484cSchristos 
13798b9484cSchristos /* Endianity encodings.  */
13898b9484cSchristos enum dwarf_endianity_encoding
13998b9484cSchristos   {
14098b9484cSchristos     /* DWARF 3.  */
14198b9484cSchristos     DW_END_default = 0x00,
14298b9484cSchristos     DW_END_big = 0x01,
14398b9484cSchristos     DW_END_little = 0x02,
14498b9484cSchristos 
14598b9484cSchristos     DW_END_lo_user = 0x40,
14698b9484cSchristos     DW_END_hi_user = 0xff
14798b9484cSchristos   };
14898b9484cSchristos 
14998b9484cSchristos /* Array ordering names and codes.  */
15098b9484cSchristos enum dwarf_array_dim_ordering
15198b9484cSchristos   {
15298b9484cSchristos     DW_ORD_row_major = 0,
15398b9484cSchristos     DW_ORD_col_major = 1
15498b9484cSchristos   };
15598b9484cSchristos 
15698b9484cSchristos /* Access attribute.  */
15798b9484cSchristos enum dwarf_access_attribute
15898b9484cSchristos   {
15998b9484cSchristos     DW_ACCESS_public = 1,
16098b9484cSchristos     DW_ACCESS_protected = 2,
16198b9484cSchristos     DW_ACCESS_private = 3
16298b9484cSchristos   };
16398b9484cSchristos 
16498b9484cSchristos /* Visibility.  */
16598b9484cSchristos enum dwarf_visibility_attribute
16698b9484cSchristos   {
16798b9484cSchristos     DW_VIS_local = 1,
16898b9484cSchristos     DW_VIS_exported = 2,
16998b9484cSchristos     DW_VIS_qualified = 3
17098b9484cSchristos   };
17198b9484cSchristos 
17298b9484cSchristos /* Virtuality.  */
17398b9484cSchristos enum dwarf_virtuality_attribute
17498b9484cSchristos   {
17598b9484cSchristos     DW_VIRTUALITY_none = 0,
17698b9484cSchristos     DW_VIRTUALITY_virtual = 1,
17798b9484cSchristos     DW_VIRTUALITY_pure_virtual = 2
17898b9484cSchristos   };
17998b9484cSchristos 
18098b9484cSchristos /* Case sensitivity.  */
18198b9484cSchristos enum dwarf_id_case
18298b9484cSchristos   {
18398b9484cSchristos     DW_ID_case_sensitive = 0,
18498b9484cSchristos     DW_ID_up_case = 1,
18598b9484cSchristos     DW_ID_down_case = 2,
18698b9484cSchristos     DW_ID_case_insensitive = 3
18798b9484cSchristos   };
18898b9484cSchristos 
18998b9484cSchristos /* Calling convention.  */
19098b9484cSchristos enum dwarf_calling_convention
19198b9484cSchristos   {
19298b9484cSchristos     DW_CC_normal = 0x1,
19398b9484cSchristos     DW_CC_program = 0x2,
19498b9484cSchristos     DW_CC_nocall = 0x3,
19598b9484cSchristos 
196796c32c9Schristos     /* DWARF 5.  */
197796c32c9Schristos     DW_CC_pass_by_reference = 0x4,
198796c32c9Schristos     DW_CC_pass_by_value = 0x5,
199796c32c9Schristos 
20098b9484cSchristos     DW_CC_lo_user = 0x40,
20198b9484cSchristos     DW_CC_hi_user = 0xff,
20298b9484cSchristos 
20398b9484cSchristos     DW_CC_GNU_renesas_sh = 0x40,
20498b9484cSchristos     DW_CC_GNU_borland_fastcall_i386 = 0x41,
20598b9484cSchristos 
20698b9484cSchristos     /* This DW_CC_ value is not currently generated by any toolchain.  It is
20798b9484cSchristos        used internally to GDB to indicate OpenCL C functions that have been
20898b9484cSchristos        compiled with the IBM XL C for OpenCL compiler and use a non-platform
20998b9484cSchristos        calling convention for passing OpenCL C vector types.  This value may
21098b9484cSchristos        be changed freely as long as it does not conflict with any other DW_CC_
21198b9484cSchristos        value defined here.  */
21298b9484cSchristos     DW_CC_GDB_IBM_OpenCL = 0xff
21398b9484cSchristos   };
21498b9484cSchristos 
21598b9484cSchristos /* Inline attribute.  */
21698b9484cSchristos enum dwarf_inline_attribute
21798b9484cSchristos   {
21898b9484cSchristos     DW_INL_not_inlined = 0,
21998b9484cSchristos     DW_INL_inlined = 1,
22098b9484cSchristos     DW_INL_declared_not_inlined = 2,
22198b9484cSchristos     DW_INL_declared_inlined = 3
22298b9484cSchristos   };
22398b9484cSchristos 
22498b9484cSchristos /* Discriminant lists.  */
22598b9484cSchristos enum dwarf_discrim_list
22698b9484cSchristos   {
22798b9484cSchristos     DW_DSC_label = 0,
22898b9484cSchristos     DW_DSC_range = 1
22998b9484cSchristos   };
23098b9484cSchristos 
23198b9484cSchristos /* Line number opcodes.  */
23298b9484cSchristos enum dwarf_line_number_ops
23398b9484cSchristos   {
23498b9484cSchristos     DW_LNS_extended_op = 0,
23598b9484cSchristos     DW_LNS_copy = 1,
23698b9484cSchristos     DW_LNS_advance_pc = 2,
23798b9484cSchristos     DW_LNS_advance_line = 3,
23898b9484cSchristos     DW_LNS_set_file = 4,
23998b9484cSchristos     DW_LNS_set_column = 5,
24098b9484cSchristos     DW_LNS_negate_stmt = 6,
24198b9484cSchristos     DW_LNS_set_basic_block = 7,
24298b9484cSchristos     DW_LNS_const_add_pc = 8,
24398b9484cSchristos     DW_LNS_fixed_advance_pc = 9,
24498b9484cSchristos     /* DWARF 3.  */
24598b9484cSchristos     DW_LNS_set_prologue_end = 10,
24698b9484cSchristos     DW_LNS_set_epilogue_begin = 11,
24798b9484cSchristos     DW_LNS_set_isa = 12
24898b9484cSchristos   };
24998b9484cSchristos 
25098b9484cSchristos /* Line number extended opcodes.  */
25198b9484cSchristos enum dwarf_line_number_x_ops
25298b9484cSchristos   {
25398b9484cSchristos     DW_LNE_end_sequence = 1,
25498b9484cSchristos     DW_LNE_set_address = 2,
25598b9484cSchristos     DW_LNE_define_file = 3,
25698b9484cSchristos     DW_LNE_set_discriminator = 4,
25798b9484cSchristos     /* HP extensions.  */
25898b9484cSchristos     DW_LNE_HP_negate_is_UV_update      = 0x11,
25998b9484cSchristos     DW_LNE_HP_push_context             = 0x12,
26098b9484cSchristos     DW_LNE_HP_pop_context              = 0x13,
26198b9484cSchristos     DW_LNE_HP_set_file_line_column     = 0x14,
26298b9484cSchristos     DW_LNE_HP_set_routine_name         = 0x15,
26398b9484cSchristos     DW_LNE_HP_set_sequence             = 0x16,
26498b9484cSchristos     DW_LNE_HP_negate_post_semantics    = 0x17,
26598b9484cSchristos     DW_LNE_HP_negate_function_exit     = 0x18,
26698b9484cSchristos     DW_LNE_HP_negate_front_end_logical = 0x19,
26798b9484cSchristos     DW_LNE_HP_define_proc              = 0x20,
26898b9484cSchristos     DW_LNE_HP_source_file_correlation  = 0x80,
26998b9484cSchristos 
27098b9484cSchristos     DW_LNE_lo_user = 0x80,
27198b9484cSchristos     DW_LNE_hi_user = 0xff
27298b9484cSchristos   };
27398b9484cSchristos 
27498b9484cSchristos /* Sub-opcodes for DW_LNE_HP_source_file_correlation.  */
27598b9484cSchristos enum dwarf_line_number_hp_sfc_ops
27698b9484cSchristos   {
27798b9484cSchristos     DW_LNE_HP_SFC_formfeed = 1,
27898b9484cSchristos     DW_LNE_HP_SFC_set_listing_line = 2,
27998b9484cSchristos     DW_LNE_HP_SFC_associate = 3
28098b9484cSchristos   };
28198b9484cSchristos 
282796c32c9Schristos /* Content type codes in line table directory_entry_format
283796c32c9Schristos    and file_name_entry_format sequences.  */
284796c32c9Schristos enum dwarf_line_number_content_type
285796c32c9Schristos   {
286796c32c9Schristos     DW_LNCT_path = 0x1,
287796c32c9Schristos     DW_LNCT_directory_index = 0x2,
288796c32c9Schristos     DW_LNCT_timestamp = 0x3,
289796c32c9Schristos     DW_LNCT_size = 0x4,
290796c32c9Schristos     DW_LNCT_MD5 = 0x5,
291796c32c9Schristos     DW_LNCT_lo_user = 0x2000,
292796c32c9Schristos     DW_LNCT_hi_user = 0x3fff
293796c32c9Schristos   };
294a2e2270fSchristos 
295796c32c9Schristos /* Type codes for location list entries.  */
296a2e2270fSchristos enum dwarf_location_list_entry_type
29798b9484cSchristos   {
298796c32c9Schristos     DW_LLE_end_of_list = 0x00,
299796c32c9Schristos     DW_LLE_base_addressx = 0x01,
300796c32c9Schristos     DW_LLE_startx_endx = 0x02,
301796c32c9Schristos     DW_LLE_startx_length = 0x03,
302796c32c9Schristos     DW_LLE_offset_pair = 0x04,
303796c32c9Schristos     DW_LLE_default_location = 0x05,
304796c32c9Schristos     DW_LLE_base_address = 0x06,
305796c32c9Schristos     DW_LLE_start_end = 0x07,
306796c32c9Schristos     DW_LLE_start_length = 0x08,
307796c32c9Schristos 
3084559860eSchristos     /* <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/2017-April/004347.html>
3094559860eSchristos        has the proposal for now; only available to list members.
3104559860eSchristos 
3114559860eSchristos        A (possibly updated) copy of the proposal is available at
3124559860eSchristos        <http://people.redhat.com/aoliva/papers/sfn/dwarf6-sfn-lvu.txt>.  */
3134559860eSchristos     DW_LLE_GNU_view_pair = 0x09,
3144559860eSchristos #define DW_LLE_view_pair DW_LLE_GNU_view_pair
3154559860eSchristos 
316796c32c9Schristos     /* Former extension for Fission.
317796c32c9Schristos        See http://gcc.gnu.org/wiki/DebugFission.  */
318796c32c9Schristos     DW_LLE_GNU_end_of_list_entry = 0x00,
319796c32c9Schristos     DW_LLE_GNU_base_address_selection_entry = 0x01,
320796c32c9Schristos     DW_LLE_GNU_start_end_entry = 0x02,
321796c32c9Schristos     DW_LLE_GNU_start_length_entry = 0x03
32298b9484cSchristos   };
32398b9484cSchristos 
32498b9484cSchristos #define DW_CIE_ID	  0xffffffff
32598b9484cSchristos #define DW64_CIE_ID	  0xffffffffffffffffULL
32698b9484cSchristos 
32798b9484cSchristos #define DW_CFA_extended   0
32898b9484cSchristos 
32998b9484cSchristos #define DW_CHILDREN_no		     0x00
33098b9484cSchristos #define DW_CHILDREN_yes		     0x01
33198b9484cSchristos 
33298b9484cSchristos #define DW_ADDR_none		0
33398b9484cSchristos 
33498b9484cSchristos /* Source language names and codes.  */
33598b9484cSchristos enum dwarf_source_language
33698b9484cSchristos   {
33798b9484cSchristos     DW_LANG_C89 = 0x0001,
33898b9484cSchristos     DW_LANG_C = 0x0002,
33998b9484cSchristos     DW_LANG_Ada83 = 0x0003,
34098b9484cSchristos     DW_LANG_C_plus_plus = 0x0004,
34198b9484cSchristos     DW_LANG_Cobol74 = 0x0005,
34298b9484cSchristos     DW_LANG_Cobol85 = 0x0006,
34398b9484cSchristos     DW_LANG_Fortran77 = 0x0007,
34498b9484cSchristos     DW_LANG_Fortran90 = 0x0008,
34598b9484cSchristos     DW_LANG_Pascal83 = 0x0009,
34698b9484cSchristos     DW_LANG_Modula2 = 0x000a,
34798b9484cSchristos     /* DWARF 3.  */
34898b9484cSchristos     DW_LANG_Java = 0x000b,
34998b9484cSchristos     DW_LANG_C99 = 0x000c,
35098b9484cSchristos     DW_LANG_Ada95 = 0x000d,
35198b9484cSchristos     DW_LANG_Fortran95 = 0x000e,
35298b9484cSchristos     DW_LANG_PLI = 0x000f,
35398b9484cSchristos     DW_LANG_ObjC = 0x0010,
35498b9484cSchristos     DW_LANG_ObjC_plus_plus = 0x0011,
35598b9484cSchristos     DW_LANG_UPC = 0x0012,
35698b9484cSchristos     DW_LANG_D = 0x0013,
35798b9484cSchristos     /* DWARF 4.  */
35898b9484cSchristos     DW_LANG_Python = 0x0014,
35998b9484cSchristos     /* DWARF 5.  */
360796c32c9Schristos     DW_LANG_OpenCL = 0x0015,
36198b9484cSchristos     DW_LANG_Go = 0x0016,
362796c32c9Schristos     DW_LANG_Modula3 = 0x0017,
363796c32c9Schristos     DW_LANG_Haskell = 0x0018,
364796c32c9Schristos     DW_LANG_C_plus_plus_03 = 0x0019,
365796c32c9Schristos     DW_LANG_C_plus_plus_11 = 0x001a,
366796c32c9Schristos     DW_LANG_OCaml = 0x001b,
367ba340e45Schristos     DW_LANG_Rust = 0x001c,
368968cf8f2Schristos     DW_LANG_C11 = 0x001d,
369796c32c9Schristos     DW_LANG_Swift = 0x001e,
370796c32c9Schristos     DW_LANG_Julia = 0x001f,
371796c32c9Schristos     DW_LANG_Dylan = 0x0020,
372968cf8f2Schristos     DW_LANG_C_plus_plus_14 = 0x0021,
373212397c6Schristos     DW_LANG_Fortran03 = 0x0022,
374212397c6Schristos     DW_LANG_Fortran08 = 0x0023,
375796c32c9Schristos     DW_LANG_RenderScript = 0x0024,
376*e663ba6eSchristos     DW_LANG_BLISS = 0x0025,
377*e663ba6eSchristos     DW_LANG_Kotlin = 0x0026,
378*e663ba6eSchristos     DW_LANG_Zig = 0x0027,
379*e663ba6eSchristos     DW_LANG_Crystal = 0x0028,
380*e663ba6eSchristos     DW_LANG_C_plus_plus_17 = 0x002a,
381*e663ba6eSchristos     DW_LANG_C_plus_plus_20 = 0x002b,
382*e663ba6eSchristos     DW_LANG_C17 = 0x002c,
383*e663ba6eSchristos     DW_LANG_Fortran18 = 0x002d,
384*e663ba6eSchristos     DW_LANG_Ada2005 = 0x002e,
385*e663ba6eSchristos     DW_LANG_Ada2012 = 0x002f,
386968cf8f2Schristos 
38798b9484cSchristos     DW_LANG_lo_user = 0x8000,	/* Implementation-defined range start.  */
38898b9484cSchristos     DW_LANG_hi_user = 0xffff,	/* Implementation-defined range start.  */
38998b9484cSchristos 
39098b9484cSchristos     /* MIPS.  */
39198b9484cSchristos     DW_LANG_Mips_Assembler = 0x8001,
39298b9484cSchristos     /* UPC.  */
39398b9484cSchristos     DW_LANG_Upc = 0x8765,
39498b9484cSchristos     /* HP extensions.  */
39598b9484cSchristos     DW_LANG_HP_Bliss     = 0x8003,
39698b9484cSchristos     DW_LANG_HP_Basic91   = 0x8004,
39798b9484cSchristos     DW_LANG_HP_Pascal91  = 0x8005,
39898b9484cSchristos     DW_LANG_HP_IMacro    = 0x8006,
399ba340e45Schristos     DW_LANG_HP_Assembler = 0x8007,
400ba340e45Schristos 
401ba340e45Schristos     /* Rust extension, but replaced in DWARF 5.  */
402ba340e45Schristos     DW_LANG_Rust_old = 0x9000
40398b9484cSchristos   };
40498b9484cSchristos 
40598b9484cSchristos /* Names and codes for macro information.  */
40698b9484cSchristos enum dwarf_macinfo_record_type
40798b9484cSchristos   {
40898b9484cSchristos     DW_MACINFO_define = 1,
40998b9484cSchristos     DW_MACINFO_undef = 2,
41098b9484cSchristos     DW_MACINFO_start_file = 3,
41198b9484cSchristos     DW_MACINFO_end_file = 4,
41298b9484cSchristos     DW_MACINFO_vendor_ext = 255
41398b9484cSchristos   };
414a2e2270fSchristos 
415796c32c9Schristos /* DW_TAG_defaulted/DW_TAG_GNU_defaulted attributes.  */
416796c32c9Schristos enum dwarf_defaulted_attribute
417796c32c9Schristos   {
418796c32c9Schristos     DW_DEFAULTED_no = 0x00,
419796c32c9Schristos     DW_DEFAULTED_in_class = 0x01,
420796c32c9Schristos     DW_DEFAULTED_out_of_class = 0x02
421796c32c9Schristos   };
422796c32c9Schristos 
423a2e2270fSchristos /* Names and codes for new style macro information.  */
424a2e2270fSchristos enum dwarf_macro_record_type
425a2e2270fSchristos   {
426796c32c9Schristos     DW_MACRO_define = 0x01,
427796c32c9Schristos     DW_MACRO_undef = 0x02,
428796c32c9Schristos     DW_MACRO_start_file = 0x03,
429796c32c9Schristos     DW_MACRO_end_file = 0x04,
430796c32c9Schristos     DW_MACRO_define_strp = 0x05,
431796c32c9Schristos     DW_MACRO_undef_strp = 0x06,
432796c32c9Schristos     DW_MACRO_import = 0x07,
433796c32c9Schristos     DW_MACRO_define_sup = 0x08,
434796c32c9Schristos     DW_MACRO_undef_sup = 0x09,
435796c32c9Schristos     DW_MACRO_import_sup = 0x0a,
436796c32c9Schristos     DW_MACRO_define_strx = 0x0b,
437796c32c9Schristos     DW_MACRO_undef_strx = 0x0c,
438796c32c9Schristos     DW_MACRO_lo_user = 0xe0,
439796c32c9Schristos     DW_MACRO_hi_user = 0xff,
440796c32c9Schristos 
441796c32c9Schristos     /* Compatibility macros for the GNU .debug_macro extension.  */
442796c32c9Schristos     DW_MACRO_GNU_define = 0x01,
443796c32c9Schristos     DW_MACRO_GNU_undef = 0x02,
444796c32c9Schristos     DW_MACRO_GNU_start_file = 0x03,
445796c32c9Schristos     DW_MACRO_GNU_end_file = 0x04,
446796c32c9Schristos     DW_MACRO_GNU_define_indirect = 0x05,
447796c32c9Schristos     DW_MACRO_GNU_undef_indirect = 0x06,
448796c32c9Schristos     DW_MACRO_GNU_transparent_include = 0x07,
449a2e2270fSchristos     /* Extensions for DWZ multifile.
450a2e2270fSchristos        See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open .  */
451796c32c9Schristos     DW_MACRO_GNU_define_indirect_alt = 0x08,
452796c32c9Schristos     DW_MACRO_GNU_undef_indirect_alt = 0x09,
453796c32c9Schristos     DW_MACRO_GNU_transparent_include_alt = 0x0a,
454a2e2270fSchristos     DW_MACRO_GNU_lo_user = 0xe0,
455a2e2270fSchristos     DW_MACRO_GNU_hi_user = 0xff
456a2e2270fSchristos   };
457796c32c9Schristos 
458796c32c9Schristos /* Range list entry kinds in .debug_rnglists* section.  */
459796c32c9Schristos enum dwarf_range_list_entry
460796c32c9Schristos   {
461796c32c9Schristos     DW_RLE_end_of_list = 0x00,
462796c32c9Schristos     DW_RLE_base_addressx = 0x01,
463796c32c9Schristos     DW_RLE_startx_endx = 0x02,
464796c32c9Schristos     DW_RLE_startx_length = 0x03,
465796c32c9Schristos     DW_RLE_offset_pair = 0x04,
466796c32c9Schristos     DW_RLE_base_address = 0x05,
467796c32c9Schristos     DW_RLE_start_end = 0x06,
468796c32c9Schristos     DW_RLE_start_length = 0x07
469796c32c9Schristos   };
47098b9484cSchristos 
47198b9484cSchristos /* @@@ For use with GNU frame unwind information.  */
47298b9484cSchristos 
47398b9484cSchristos #define DW_EH_PE_absptr		0x00
47498b9484cSchristos #define DW_EH_PE_omit		0xff
47598b9484cSchristos 
47698b9484cSchristos #define DW_EH_PE_uleb128	0x01
47798b9484cSchristos #define DW_EH_PE_udata2		0x02
47898b9484cSchristos #define DW_EH_PE_udata4		0x03
47998b9484cSchristos #define DW_EH_PE_udata8		0x04
48098b9484cSchristos #define DW_EH_PE_sleb128	0x09
48198b9484cSchristos #define DW_EH_PE_sdata2		0x0A
48298b9484cSchristos #define DW_EH_PE_sdata4		0x0B
48398b9484cSchristos #define DW_EH_PE_sdata8		0x0C
48498b9484cSchristos #define DW_EH_PE_signed		0x08
48598b9484cSchristos 
48698b9484cSchristos #define DW_EH_PE_pcrel		0x10
48798b9484cSchristos #define DW_EH_PE_textrel	0x20
48898b9484cSchristos #define DW_EH_PE_datarel	0x30
48998b9484cSchristos #define DW_EH_PE_funcrel	0x40
49098b9484cSchristos #define DW_EH_PE_aligned	0x50
49198b9484cSchristos 
49298b9484cSchristos #define DW_EH_PE_indirect	0x80
49398b9484cSchristos 
494a2e2270fSchristos /* Codes for the debug sections in a dwarf package (.dwp) file.
4958dffb485Schristos    (From the pre-standard formats Extensions for Fission.
4968dffb485Schristos    See http://gcc.gnu.org/wiki/DebugFissionDWP).  */
497a2e2270fSchristos enum dwarf_sect
498a2e2270fSchristos {
499a2e2270fSchristos   DW_SECT_INFO = 1,
500a2e2270fSchristos   DW_SECT_TYPES = 2,
501a2e2270fSchristos   DW_SECT_ABBREV = 3,
502a2e2270fSchristos   DW_SECT_LINE = 4,
503a2e2270fSchristos   DW_SECT_LOC = 5,
504a2e2270fSchristos   DW_SECT_STR_OFFSETS = 6,
505a2e2270fSchristos   DW_SECT_MACINFO = 7,
506a2e2270fSchristos   DW_SECT_MACRO = 8,
507a2e2270fSchristos   DW_SECT_MAX = 8
508a2e2270fSchristos };
509a2e2270fSchristos 
5108dffb485Schristos /* Codes for the debug sections in a dwarf package (.dwp) file.
5118dffb485Schristos    (From the official DWARF v5 spec.
5128dffb485Schristos    See http://dwarfstd.org/doc/DWARF5.pdf, section 7.3.5).  */
5138dffb485Schristos enum dwarf_sect_v5
5148dffb485Schristos {
5158dffb485Schristos   DW_SECT_INFO_V5 = 1,
5168dffb485Schristos   DW_SECT_RESERVED_V5 = 2,
5178dffb485Schristos   DW_SECT_ABBREV_V5 = 3,
5188dffb485Schristos   DW_SECT_LINE_V5 = 4,
5198dffb485Schristos   DW_SECT_LOCLISTS_V5 = 5,
5208dffb485Schristos   DW_SECT_STR_OFFSETS_V5 = 6,
5218dffb485Schristos   DW_SECT_MACRO_V5 = 7,
5228dffb485Schristos   DW_SECT_RNGLISTS_V5 = 8,
5238dffb485Schristos   DW_SECT_MAX_V5 = 8
5248dffb485Schristos };
5258dffb485Schristos 
526a2e2270fSchristos #ifdef __cplusplus
527a2e2270fSchristos extern "C" {
528a2e2270fSchristos #endif /* __cplusplus */
529a2e2270fSchristos 
530a2e2270fSchristos /* Return the name of a DW_TAG_ constant, or NULL if the value is not
531a2e2270fSchristos    recognized.  */
532a2e2270fSchristos extern const char *get_DW_TAG_name (unsigned int tag);
533a2e2270fSchristos 
534a2e2270fSchristos /* Return the name of a DW_AT_ constant, or NULL if the value is not
535a2e2270fSchristos    recognized.  */
536a2e2270fSchristos extern const char *get_DW_AT_name (unsigned int attr);
537a2e2270fSchristos 
538a2e2270fSchristos /* Return the name of a DW_FORM_ constant, or NULL if the value is not
539a2e2270fSchristos    recognized.  */
540a2e2270fSchristos extern const char *get_DW_FORM_name (unsigned int form);
541a2e2270fSchristos 
542a2e2270fSchristos /* Return the name of a DW_OP_ constant, or NULL if the value is not
543a2e2270fSchristos    recognized.  */
544a2e2270fSchristos extern const char *get_DW_OP_name (unsigned int op);
545a2e2270fSchristos 
546a2e2270fSchristos /* Return the name of a DW_ATE_ constant, or NULL if the value is not
547a2e2270fSchristos    recognized.  */
548a2e2270fSchristos extern const char *get_DW_ATE_name (unsigned int enc);
549a2e2270fSchristos 
550a2e2270fSchristos /* Return the name of a DW_CFA_ constant, or NULL if the value is not
551a2e2270fSchristos    recognized.  */
552a2e2270fSchristos extern const char *get_DW_CFA_name (unsigned int opc);
553a2e2270fSchristos 
5544559860eSchristos /* Return the name of a DW_IDX_ constant, or NULL if the value is not
5554559860eSchristos    recognized.  */
5564559860eSchristos extern const char *get_DW_IDX_name (unsigned int idx);
5574559860eSchristos 
5584b169a6bSchristos /* Return the name of a DW_UT_ constant, or NULL if the value is not
5594b169a6bSchristos    recognized.  */
5604b169a6bSchristos extern const char *get_DW_UT_name (unsigned int ut);
5614b169a6bSchristos 
562a2e2270fSchristos #ifdef __cplusplus
563a2e2270fSchristos }
564a2e2270fSchristos #endif /* __cplusplus */
565a2e2270fSchristos 
56698b9484cSchristos #endif /* _DWARF2_H */
567