1169689Skan/* Declarations and definitions of codes relating to the DWARF2 and
2169689Skan   DWARF3 symbolic debugging information formats.
3169689Skan   Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
4169689Skan   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
550397Sobrien
690075Sobrien   Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
7132718Skan   Office (AJPO), Florida State University and Silicon Graphics Inc.
890075Sobrien   provided support for this effort -- June 21, 1995.
950397Sobrien
1090075Sobrien   Derived from the DWARF 1 implementation written by Ron Guilmette
1190075Sobrien   (rfg@netcom.com), November 1990.
1250397Sobrien
13169689Skan   This file is part of GCC.
1450397Sobrien
15169689Skan   GCC is free software; you can redistribute it and/or modify it under
16169689Skan   the terms of the GNU General Public License as published by the Free
17169689Skan   Software Foundation; either version 2, or (at your option) any later
18169689Skan   version.
1990075Sobrien
20169689Skan   GCC is distributed in the hope that it will be useful, but WITHOUT
21169689Skan   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22169689Skan   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
23169689Skan   License for more details.
2490075Sobrien
25169689Skan   You should have received a copy of the GNU General Public License
26169689Skan   along with GCC; see the file COPYING.  If not, write to the Free
27169689Skan   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
28169689Skan   02110-1301, USA.  */
2950397Sobrien
3050397Sobrien/* This file is derived from the DWARF specification (a public document)
3150397Sobrien   Revision 2.0.0 (July 27, 1993) developed by the UNIX International
3250397Sobrien   Programming Languages Special Interest Group (UI/PLSIG) and distributed
3350397Sobrien   by UNIX International.  Copies of this specification are available from
3490075Sobrien   UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
3550397Sobrien
3690075Sobrien   This file also now contains definitions from the DWARF 3 specification.  */
3790075Sobrien
3850397Sobrien/* This file is shared between GCC and GDB, and should not contain
3950397Sobrien   prototypes.  */
4050397Sobrien
41132718Skan#ifndef GCC_DWARF2_H
42132718Skan#define GCC_DWARF2_H
43132718Skan
44169689Skan/* Structure found in the .debug_line section.  */
45169689Skantypedef struct
46169689Skan{
47169689Skan  unsigned char li_length          [4];
48169689Skan  unsigned char li_version         [2];
49169689Skan  unsigned char li_prologue_length [4];
50169689Skan  unsigned char li_min_insn_length [1];
51169689Skan  unsigned char li_default_is_stmt [1];
52169689Skan  unsigned char li_line_base       [1];
53169689Skan  unsigned char li_line_range      [1];
54169689Skan  unsigned char li_opcode_base     [1];
55169689Skan}
56169689SkanDWARF2_External_LineInfo;
57169689Skan
58169689Skantypedef struct
59169689Skan{
60169689Skan  unsigned long  li_length;
61169689Skan  unsigned short li_version;
62169689Skan  unsigned int   li_prologue_length;
63169689Skan  unsigned char  li_min_insn_length;
64169689Skan  unsigned char  li_default_is_stmt;
65169689Skan  int            li_line_base;
66169689Skan  unsigned char  li_line_range;
67169689Skan  unsigned char  li_opcode_base;
68169689Skan}
69169689SkanDWARF2_Internal_LineInfo;
70169689Skan
71169689Skan/* Structure found in .debug_pubnames section.  */
72169689Skantypedef struct
73169689Skan{
74169689Skan  unsigned char pn_length  [4];
75169689Skan  unsigned char pn_version [2];
76169689Skan  unsigned char pn_offset  [4];
77169689Skan  unsigned char pn_size    [4];
78169689Skan}
79169689SkanDWARF2_External_PubNames;
80169689Skan
81169689Skantypedef struct
82169689Skan{
83169689Skan  unsigned long  pn_length;
84169689Skan  unsigned short pn_version;
85169689Skan  unsigned long  pn_offset;
86169689Skan  unsigned long  pn_size;
87169689Skan}
88169689SkanDWARF2_Internal_PubNames;
89169689Skan
90169689Skan/* Structure found in .debug_info section.  */
91169689Skantypedef struct
92169689Skan{
93169689Skan  unsigned char  cu_length        [4];
94169689Skan  unsigned char  cu_version       [2];
95169689Skan  unsigned char  cu_abbrev_offset [4];
96169689Skan  unsigned char  cu_pointer_size  [1];
97169689Skan}
98169689SkanDWARF2_External_CompUnit;
99169689Skan
100169689Skantypedef struct
101169689Skan{
102169689Skan  unsigned long  cu_length;
103169689Skan  unsigned short cu_version;
104169689Skan  unsigned long  cu_abbrev_offset;
105169689Skan  unsigned char  cu_pointer_size;
106169689Skan}
107169689SkanDWARF2_Internal_CompUnit;
108169689Skan
109169689Skantypedef struct
110169689Skan{
111169689Skan  unsigned char  ar_length       [4];
112169689Skan  unsigned char  ar_version      [2];
113169689Skan  unsigned char  ar_info_offset  [4];
114169689Skan  unsigned char  ar_pointer_size [1];
115169689Skan  unsigned char  ar_segment_size [1];
116169689Skan}
117169689SkanDWARF2_External_ARange;
118169689Skan
119169689Skantypedef struct
120169689Skan{
121169689Skan  unsigned long  ar_length;
122169689Skan  unsigned short ar_version;
123169689Skan  unsigned long  ar_info_offset;
124169689Skan  unsigned char  ar_pointer_size;
125169689Skan  unsigned char  ar_segment_size;
126169689Skan}
127169689SkanDWARF2_Internal_ARange;
128169689Skan
129169689Skan
13050397Sobrien/* Tag names and codes.  */
13150397Sobrienenum dwarf_tag
13250397Sobrien  {
13350397Sobrien    DW_TAG_padding = 0x00,
13450397Sobrien    DW_TAG_array_type = 0x01,
13550397Sobrien    DW_TAG_class_type = 0x02,
13650397Sobrien    DW_TAG_entry_point = 0x03,
13750397Sobrien    DW_TAG_enumeration_type = 0x04,
13850397Sobrien    DW_TAG_formal_parameter = 0x05,
13950397Sobrien    DW_TAG_imported_declaration = 0x08,
14050397Sobrien    DW_TAG_label = 0x0a,
14150397Sobrien    DW_TAG_lexical_block = 0x0b,
14250397Sobrien    DW_TAG_member = 0x0d,
14350397Sobrien    DW_TAG_pointer_type = 0x0f,
14450397Sobrien    DW_TAG_reference_type = 0x10,
14550397Sobrien    DW_TAG_compile_unit = 0x11,
14650397Sobrien    DW_TAG_string_type = 0x12,
14750397Sobrien    DW_TAG_structure_type = 0x13,
14850397Sobrien    DW_TAG_subroutine_type = 0x15,
14950397Sobrien    DW_TAG_typedef = 0x16,
15050397Sobrien    DW_TAG_union_type = 0x17,
15150397Sobrien    DW_TAG_unspecified_parameters = 0x18,
15250397Sobrien    DW_TAG_variant = 0x19,
15350397Sobrien    DW_TAG_common_block = 0x1a,
15450397Sobrien    DW_TAG_common_inclusion = 0x1b,
15550397Sobrien    DW_TAG_inheritance = 0x1c,
15650397Sobrien    DW_TAG_inlined_subroutine = 0x1d,
15750397Sobrien    DW_TAG_module = 0x1e,
15850397Sobrien    DW_TAG_ptr_to_member_type = 0x1f,
15950397Sobrien    DW_TAG_set_type = 0x20,
16050397Sobrien    DW_TAG_subrange_type = 0x21,
16150397Sobrien    DW_TAG_with_stmt = 0x22,
16250397Sobrien    DW_TAG_access_declaration = 0x23,
16350397Sobrien    DW_TAG_base_type = 0x24,
16450397Sobrien    DW_TAG_catch_block = 0x25,
16550397Sobrien    DW_TAG_const_type = 0x26,
16650397Sobrien    DW_TAG_constant = 0x27,
16750397Sobrien    DW_TAG_enumerator = 0x28,
16850397Sobrien    DW_TAG_file_type = 0x29,
16950397Sobrien    DW_TAG_friend = 0x2a,
17050397Sobrien    DW_TAG_namelist = 0x2b,
17150397Sobrien    DW_TAG_namelist_item = 0x2c,
17250397Sobrien    DW_TAG_packed_type = 0x2d,
17350397Sobrien    DW_TAG_subprogram = 0x2e,
17450397Sobrien    DW_TAG_template_type_param = 0x2f,
17550397Sobrien    DW_TAG_template_value_param = 0x30,
17650397Sobrien    DW_TAG_thrown_type = 0x31,
17750397Sobrien    DW_TAG_try_block = 0x32,
17850397Sobrien    DW_TAG_variant_part = 0x33,
17950397Sobrien    DW_TAG_variable = 0x34,
18050397Sobrien    DW_TAG_volatile_type = 0x35,
18190075Sobrien    /* DWARF 3.  */
18290075Sobrien    DW_TAG_dwarf_procedure = 0x36,
18390075Sobrien    DW_TAG_restrict_type = 0x37,
18490075Sobrien    DW_TAG_interface_type = 0x38,
18590075Sobrien    DW_TAG_namespace = 0x39,
18690075Sobrien    DW_TAG_imported_module = 0x3a,
18790075Sobrien    DW_TAG_unspecified_type = 0x3b,
18890075Sobrien    DW_TAG_partial_unit = 0x3c,
18990075Sobrien    DW_TAG_imported_unit = 0x3d,
190169689Skan    DW_TAG_condition = 0x3f,
191169689Skan    DW_TAG_shared_type = 0x40,
19290075Sobrien    /* SGI/MIPS Extensions.  */
19350397Sobrien    DW_TAG_MIPS_loop = 0x4081,
194169689Skan    /* HP extensions.  See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz .  */
195169689Skan    DW_TAG_HP_array_descriptor = 0x4090,
19690075Sobrien    /* GNU extensions.  */
19790075Sobrien    DW_TAG_format_label = 0x4101,	/* For FORTRAN 77 and Fortran 90.  */
19890075Sobrien    DW_TAG_function_template = 0x4102,	/* For C++.  */
19990075Sobrien    DW_TAG_class_template = 0x4103,	/* For C++.  */
20090075Sobrien    DW_TAG_GNU_BINCL = 0x4104,
201169689Skan    DW_TAG_GNU_EINCL = 0x4105,
202169689Skan    /* Extensions for UPC.  See: http://upc.gwu.edu/~upc.  */
203169689Skan    DW_TAG_upc_shared_type = 0x8765,
204169689Skan    DW_TAG_upc_strict_type = 0x8766,
205169689Skan    DW_TAG_upc_relaxed_type = 0x8767,
206169689Skan    /* PGI (STMicroelectronics) extensions.  No documentation available.  */
207169689Skan    DW_TAG_PGI_kanji_type      = 0xA000,
208169689Skan    DW_TAG_PGI_interface_block = 0xA020
20950397Sobrien  };
21050397Sobrien
21150397Sobrien#define DW_TAG_lo_user	0x4080
21250397Sobrien#define DW_TAG_hi_user	0xffff
21350397Sobrien
21490075Sobrien/* Flag that tells whether entry has a child or not.  */
21550397Sobrien#define DW_children_no   0
21650397Sobrien#define	DW_children_yes  1
21750397Sobrien
21850397Sobrien/* Form names and codes.  */
21950397Sobrienenum dwarf_form
22050397Sobrien  {
22150397Sobrien    DW_FORM_addr = 0x01,
22250397Sobrien    DW_FORM_block2 = 0x03,
22350397Sobrien    DW_FORM_block4 = 0x04,
22450397Sobrien    DW_FORM_data2 = 0x05,
22550397Sobrien    DW_FORM_data4 = 0x06,
22650397Sobrien    DW_FORM_data8 = 0x07,
22750397Sobrien    DW_FORM_string = 0x08,
22850397Sobrien    DW_FORM_block = 0x09,
22950397Sobrien    DW_FORM_block1 = 0x0a,
23050397Sobrien    DW_FORM_data1 = 0x0b,
23150397Sobrien    DW_FORM_flag = 0x0c,
23250397Sobrien    DW_FORM_sdata = 0x0d,
23350397Sobrien    DW_FORM_strp = 0x0e,
23450397Sobrien    DW_FORM_udata = 0x0f,
23550397Sobrien    DW_FORM_ref_addr = 0x10,
23650397Sobrien    DW_FORM_ref1 = 0x11,
23750397Sobrien    DW_FORM_ref2 = 0x12,
23850397Sobrien    DW_FORM_ref4 = 0x13,
23950397Sobrien    DW_FORM_ref8 = 0x14,
24050397Sobrien    DW_FORM_ref_udata = 0x15,
24150397Sobrien    DW_FORM_indirect = 0x16
24250397Sobrien  };
24350397Sobrien
24450397Sobrien/* Attribute names and codes.  */
24550397Sobrienenum dwarf_attribute
24650397Sobrien  {
24750397Sobrien    DW_AT_sibling = 0x01,
24850397Sobrien    DW_AT_location = 0x02,
24950397Sobrien    DW_AT_name = 0x03,
25050397Sobrien    DW_AT_ordering = 0x09,
25150397Sobrien    DW_AT_subscr_data = 0x0a,
25250397Sobrien    DW_AT_byte_size = 0x0b,
25350397Sobrien    DW_AT_bit_offset = 0x0c,
25450397Sobrien    DW_AT_bit_size = 0x0d,
25550397Sobrien    DW_AT_element_list = 0x0f,
25650397Sobrien    DW_AT_stmt_list = 0x10,
25750397Sobrien    DW_AT_low_pc = 0x11,
25850397Sobrien    DW_AT_high_pc = 0x12,
25950397Sobrien    DW_AT_language = 0x13,
26050397Sobrien    DW_AT_member = 0x14,
26150397Sobrien    DW_AT_discr = 0x15,
26250397Sobrien    DW_AT_discr_value = 0x16,
26350397Sobrien    DW_AT_visibility = 0x17,
26450397Sobrien    DW_AT_import = 0x18,
26550397Sobrien    DW_AT_string_length = 0x19,
26650397Sobrien    DW_AT_common_reference = 0x1a,
26750397Sobrien    DW_AT_comp_dir = 0x1b,
26850397Sobrien    DW_AT_const_value = 0x1c,
26950397Sobrien    DW_AT_containing_type = 0x1d,
27050397Sobrien    DW_AT_default_value = 0x1e,
27150397Sobrien    DW_AT_inline = 0x20,
27250397Sobrien    DW_AT_is_optional = 0x21,
27350397Sobrien    DW_AT_lower_bound = 0x22,
27450397Sobrien    DW_AT_producer = 0x25,
27550397Sobrien    DW_AT_prototyped = 0x27,
27650397Sobrien    DW_AT_return_addr = 0x2a,
27750397Sobrien    DW_AT_start_scope = 0x2c,
27850397Sobrien    DW_AT_stride_size = 0x2e,
27950397Sobrien    DW_AT_upper_bound = 0x2f,
28050397Sobrien    DW_AT_abstract_origin = 0x31,
28150397Sobrien    DW_AT_accessibility = 0x32,
28250397Sobrien    DW_AT_address_class = 0x33,
28350397Sobrien    DW_AT_artificial = 0x34,
28450397Sobrien    DW_AT_base_types = 0x35,
28550397Sobrien    DW_AT_calling_convention = 0x36,
28650397Sobrien    DW_AT_count = 0x37,
28750397Sobrien    DW_AT_data_member_location = 0x38,
28850397Sobrien    DW_AT_decl_column = 0x39,
28950397Sobrien    DW_AT_decl_file = 0x3a,
29050397Sobrien    DW_AT_decl_line = 0x3b,
29150397Sobrien    DW_AT_declaration = 0x3c,
29250397Sobrien    DW_AT_discr_list = 0x3d,
29350397Sobrien    DW_AT_encoding = 0x3e,
29450397Sobrien    DW_AT_external = 0x3f,
29550397Sobrien    DW_AT_frame_base = 0x40,
29650397Sobrien    DW_AT_friend = 0x41,
29750397Sobrien    DW_AT_identifier_case = 0x42,
29850397Sobrien    DW_AT_macro_info = 0x43,
29950397Sobrien    DW_AT_namelist_items = 0x44,
30050397Sobrien    DW_AT_priority = 0x45,
30150397Sobrien    DW_AT_segment = 0x46,
30250397Sobrien    DW_AT_specification = 0x47,
30350397Sobrien    DW_AT_static_link = 0x48,
30450397Sobrien    DW_AT_type = 0x49,
30550397Sobrien    DW_AT_use_location = 0x4a,
30650397Sobrien    DW_AT_variable_parameter = 0x4b,
30750397Sobrien    DW_AT_virtuality = 0x4c,
30850397Sobrien    DW_AT_vtable_elem_location = 0x4d,
30990075Sobrien    /* DWARF 3 values.  */
31090075Sobrien    DW_AT_allocated     = 0x4e,
31190075Sobrien    DW_AT_associated    = 0x4f,
31290075Sobrien    DW_AT_data_location = 0x50,
31390075Sobrien    DW_AT_stride        = 0x51,
31490075Sobrien    DW_AT_entry_pc      = 0x52,
31590075Sobrien    DW_AT_use_UTF8      = 0x53,
31690075Sobrien    DW_AT_extension     = 0x54,
31790075Sobrien    DW_AT_ranges        = 0x55,
31890075Sobrien    DW_AT_trampoline    = 0x56,
31990075Sobrien    DW_AT_call_column   = 0x57,
32090075Sobrien    DW_AT_call_file     = 0x58,
32190075Sobrien    DW_AT_call_line     = 0x59,
322169689Skan    DW_AT_description   = 0x5a,
323169689Skan    DW_AT_binary_scale  = 0x5b,
324169689Skan    DW_AT_decimal_scale = 0x5c,
325169689Skan    DW_AT_small         = 0x5d,
326169689Skan    DW_AT_decimal_sign  = 0x5e,
327169689Skan    DW_AT_digit_count   = 0x5f,
328169689Skan    DW_AT_picture_string = 0x60,
329169689Skan    DW_AT_mutable       = 0x61,
330169689Skan    DW_AT_threads_scaled = 0x62,
331169689Skan    DW_AT_explicit      = 0x63,
332169689Skan    DW_AT_object_pointer = 0x64,
333169689Skan    DW_AT_endianity     = 0x65,
334169689Skan    DW_AT_elemental     = 0x66,
335169689Skan    DW_AT_pure          = 0x67,
336169689Skan    DW_AT_recursive     = 0x68,
337169689Skan    /* SGI/MIPS extensions.  */
33850397Sobrien    DW_AT_MIPS_fde = 0x2001,
33950397Sobrien    DW_AT_MIPS_loop_begin = 0x2002,
34050397Sobrien    DW_AT_MIPS_tail_loop_begin = 0x2003,
34150397Sobrien    DW_AT_MIPS_epilog_begin = 0x2004,
34250397Sobrien    DW_AT_MIPS_loop_unroll_factor = 0x2005,
34350397Sobrien    DW_AT_MIPS_software_pipeline_depth = 0x2006,
34450397Sobrien    DW_AT_MIPS_linkage_name = 0x2007,
34550397Sobrien    DW_AT_MIPS_stride = 0x2008,
34650397Sobrien    DW_AT_MIPS_abstract_name = 0x2009,
34750397Sobrien    DW_AT_MIPS_clone_origin = 0x200a,
34850397Sobrien    DW_AT_MIPS_has_inlines = 0x200b,
349169689Skan    /* HP extensions.  */
350169689Skan    DW_AT_HP_block_index         = 0x2000,
351169689Skan    DW_AT_HP_unmodifiable        = 0x2001, /* Same as DW_AT_MIPS_fde.  */
352169689Skan    DW_AT_HP_actuals_stmt_list   = 0x2010,
353169689Skan    DW_AT_HP_proc_per_section    = 0x2011,
354169689Skan    DW_AT_HP_raw_data_ptr        = 0x2012,
355169689Skan    DW_AT_HP_pass_by_reference   = 0x2013,
356169689Skan    DW_AT_HP_opt_level           = 0x2014,
357169689Skan    DW_AT_HP_prof_version_id     = 0x2015,
358169689Skan    DW_AT_HP_opt_flags           = 0x2016,
359169689Skan    DW_AT_HP_cold_region_low_pc  = 0x2017,
360169689Skan    DW_AT_HP_cold_region_high_pc = 0x2018,
361169689Skan    DW_AT_HP_all_variables_modifiable = 0x2019,
362169689Skan    DW_AT_HP_linkage_name        = 0x201a,
363169689Skan    DW_AT_HP_prof_flags          = 0x201b,  /* In comp unit of procs_info for -g.  */
36450397Sobrien    /* GNU extensions.  */
36590075Sobrien    DW_AT_sf_names   = 0x2101,
36690075Sobrien    DW_AT_src_info   = 0x2102,
36790075Sobrien    DW_AT_mac_info   = 0x2103,
36850397Sobrien    DW_AT_src_coords = 0x2104,
36950397Sobrien    DW_AT_body_begin = 0x2105,
37090075Sobrien    DW_AT_body_end   = 0x2106,
37196263Sobrien    DW_AT_GNU_vector = 0x2107,
372169689Skan    /* VMS extensions.  */
373169689Skan    DW_AT_VMS_rtnbeg_pd_address = 0x2201,
374169689Skan    /* UPC extension.  */
375169689Skan    DW_AT_upc_threads_scaled = 0x3210,
376169689Skan    /* PGI (STMicroelectronics) extensions.  */
377169689Skan    DW_AT_PGI_lbase    = 0x3a00,
378169689Skan    DW_AT_PGI_soffset  = 0x3a01,
379261188Spfg    /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks  */
380261188Spfg    DW_AT_PGI_lstride  = 0x3a02,
381261188Spfg    /* APPLE LOCAL begin radar 6386976  */
382261188Spfg    DW_AT_APPLE_block    = 0x3fe4,
383261188Spfg    /* APPLE LOCAL end radar 5811943 - Fix type of pointers to blocks  */
384261188Spfg    DW_AT_APPLE_major_runtime_vers = 0x3fe5,
385261188Spfg    DW_AT_APPLE_runtime_class = 0x3fe6
386261188Spfg    /* APPLE LOCAL end radar 6386976  */
38750397Sobrien  };
38850397Sobrien
38990075Sobrien#define DW_AT_lo_user	0x2000	/* Implementation-defined range start.  */
39090075Sobrien#define DW_AT_hi_user	0x3ff0	/* Implementation-defined range end.  */
39150397Sobrien
39250397Sobrien/* Location atom names and codes.  */
39350397Sobrienenum dwarf_location_atom
39450397Sobrien  {
39550397Sobrien    DW_OP_addr = 0x03,
39650397Sobrien    DW_OP_deref = 0x06,
39750397Sobrien    DW_OP_const1u = 0x08,
39850397Sobrien    DW_OP_const1s = 0x09,
39950397Sobrien    DW_OP_const2u = 0x0a,
40050397Sobrien    DW_OP_const2s = 0x0b,
40150397Sobrien    DW_OP_const4u = 0x0c,
40250397Sobrien    DW_OP_const4s = 0x0d,
40350397Sobrien    DW_OP_const8u = 0x0e,
40450397Sobrien    DW_OP_const8s = 0x0f,
40550397Sobrien    DW_OP_constu = 0x10,
40650397Sobrien    DW_OP_consts = 0x11,
40750397Sobrien    DW_OP_dup = 0x12,
40850397Sobrien    DW_OP_drop = 0x13,
40950397Sobrien    DW_OP_over = 0x14,
41050397Sobrien    DW_OP_pick = 0x15,
41150397Sobrien    DW_OP_swap = 0x16,
41250397Sobrien    DW_OP_rot = 0x17,
41350397Sobrien    DW_OP_xderef = 0x18,
41450397Sobrien    DW_OP_abs = 0x19,
41550397Sobrien    DW_OP_and = 0x1a,
41650397Sobrien    DW_OP_div = 0x1b,
41750397Sobrien    DW_OP_minus = 0x1c,
41850397Sobrien    DW_OP_mod = 0x1d,
41950397Sobrien    DW_OP_mul = 0x1e,
42050397Sobrien    DW_OP_neg = 0x1f,
42150397Sobrien    DW_OP_not = 0x20,
42250397Sobrien    DW_OP_or = 0x21,
42350397Sobrien    DW_OP_plus = 0x22,
42450397Sobrien    DW_OP_plus_uconst = 0x23,
42550397Sobrien    DW_OP_shl = 0x24,
42650397Sobrien    DW_OP_shr = 0x25,
42750397Sobrien    DW_OP_shra = 0x26,
42850397Sobrien    DW_OP_xor = 0x27,
42950397Sobrien    DW_OP_bra = 0x28,
43050397Sobrien    DW_OP_eq = 0x29,
43150397Sobrien    DW_OP_ge = 0x2a,
43250397Sobrien    DW_OP_gt = 0x2b,
43350397Sobrien    DW_OP_le = 0x2c,
43450397Sobrien    DW_OP_lt = 0x2d,
43550397Sobrien    DW_OP_ne = 0x2e,
43650397Sobrien    DW_OP_skip = 0x2f,
43750397Sobrien    DW_OP_lit0 = 0x30,
43850397Sobrien    DW_OP_lit1 = 0x31,
43950397Sobrien    DW_OP_lit2 = 0x32,
44050397Sobrien    DW_OP_lit3 = 0x33,
44150397Sobrien    DW_OP_lit4 = 0x34,
44250397Sobrien    DW_OP_lit5 = 0x35,
44350397Sobrien    DW_OP_lit6 = 0x36,
44450397Sobrien    DW_OP_lit7 = 0x37,
44550397Sobrien    DW_OP_lit8 = 0x38,
44650397Sobrien    DW_OP_lit9 = 0x39,
44750397Sobrien    DW_OP_lit10 = 0x3a,
44850397Sobrien    DW_OP_lit11 = 0x3b,
44950397Sobrien    DW_OP_lit12 = 0x3c,
45050397Sobrien    DW_OP_lit13 = 0x3d,
45150397Sobrien    DW_OP_lit14 = 0x3e,
45250397Sobrien    DW_OP_lit15 = 0x3f,
45350397Sobrien    DW_OP_lit16 = 0x40,
45450397Sobrien    DW_OP_lit17 = 0x41,
45550397Sobrien    DW_OP_lit18 = 0x42,
45650397Sobrien    DW_OP_lit19 = 0x43,
45750397Sobrien    DW_OP_lit20 = 0x44,
45850397Sobrien    DW_OP_lit21 = 0x45,
45950397Sobrien    DW_OP_lit22 = 0x46,
46050397Sobrien    DW_OP_lit23 = 0x47,
46150397Sobrien    DW_OP_lit24 = 0x48,
46250397Sobrien    DW_OP_lit25 = 0x49,
46350397Sobrien    DW_OP_lit26 = 0x4a,
46450397Sobrien    DW_OP_lit27 = 0x4b,
46550397Sobrien    DW_OP_lit28 = 0x4c,
46650397Sobrien    DW_OP_lit29 = 0x4d,
46750397Sobrien    DW_OP_lit30 = 0x4e,
46850397Sobrien    DW_OP_lit31 = 0x4f,
46950397Sobrien    DW_OP_reg0 = 0x50,
47050397Sobrien    DW_OP_reg1 = 0x51,
47150397Sobrien    DW_OP_reg2 = 0x52,
47250397Sobrien    DW_OP_reg3 = 0x53,
47350397Sobrien    DW_OP_reg4 = 0x54,
47450397Sobrien    DW_OP_reg5 = 0x55,
47550397Sobrien    DW_OP_reg6 = 0x56,
47650397Sobrien    DW_OP_reg7 = 0x57,
47750397Sobrien    DW_OP_reg8 = 0x58,
47850397Sobrien    DW_OP_reg9 = 0x59,
47950397Sobrien    DW_OP_reg10 = 0x5a,
48050397Sobrien    DW_OP_reg11 = 0x5b,
48150397Sobrien    DW_OP_reg12 = 0x5c,
48250397Sobrien    DW_OP_reg13 = 0x5d,
48350397Sobrien    DW_OP_reg14 = 0x5e,
48450397Sobrien    DW_OP_reg15 = 0x5f,
48550397Sobrien    DW_OP_reg16 = 0x60,
48650397Sobrien    DW_OP_reg17 = 0x61,
48750397Sobrien    DW_OP_reg18 = 0x62,
48850397Sobrien    DW_OP_reg19 = 0x63,
48950397Sobrien    DW_OP_reg20 = 0x64,
49050397Sobrien    DW_OP_reg21 = 0x65,
49150397Sobrien    DW_OP_reg22 = 0x66,
49250397Sobrien    DW_OP_reg23 = 0x67,
49350397Sobrien    DW_OP_reg24 = 0x68,
49450397Sobrien    DW_OP_reg25 = 0x69,
49550397Sobrien    DW_OP_reg26 = 0x6a,
49650397Sobrien    DW_OP_reg27 = 0x6b,
49750397Sobrien    DW_OP_reg28 = 0x6c,
49850397Sobrien    DW_OP_reg29 = 0x6d,
49950397Sobrien    DW_OP_reg30 = 0x6e,
50050397Sobrien    DW_OP_reg31 = 0x6f,
50150397Sobrien    DW_OP_breg0 = 0x70,
50250397Sobrien    DW_OP_breg1 = 0x71,
50350397Sobrien    DW_OP_breg2 = 0x72,
50450397Sobrien    DW_OP_breg3 = 0x73,
50550397Sobrien    DW_OP_breg4 = 0x74,
50650397Sobrien    DW_OP_breg5 = 0x75,
50750397Sobrien    DW_OP_breg6 = 0x76,
50850397Sobrien    DW_OP_breg7 = 0x77,
50950397Sobrien    DW_OP_breg8 = 0x78,
51050397Sobrien    DW_OP_breg9 = 0x79,
51150397Sobrien    DW_OP_breg10 = 0x7a,
51250397Sobrien    DW_OP_breg11 = 0x7b,
51350397Sobrien    DW_OP_breg12 = 0x7c,
51450397Sobrien    DW_OP_breg13 = 0x7d,
51550397Sobrien    DW_OP_breg14 = 0x7e,
51650397Sobrien    DW_OP_breg15 = 0x7f,
51750397Sobrien    DW_OP_breg16 = 0x80,
51850397Sobrien    DW_OP_breg17 = 0x81,
51950397Sobrien    DW_OP_breg18 = 0x82,
52050397Sobrien    DW_OP_breg19 = 0x83,
52150397Sobrien    DW_OP_breg20 = 0x84,
52250397Sobrien    DW_OP_breg21 = 0x85,
52350397Sobrien    DW_OP_breg22 = 0x86,
52450397Sobrien    DW_OP_breg23 = 0x87,
52550397Sobrien    DW_OP_breg24 = 0x88,
52650397Sobrien    DW_OP_breg25 = 0x89,
52750397Sobrien    DW_OP_breg26 = 0x8a,
52850397Sobrien    DW_OP_breg27 = 0x8b,
52950397Sobrien    DW_OP_breg28 = 0x8c,
53050397Sobrien    DW_OP_breg29 = 0x8d,
53150397Sobrien    DW_OP_breg30 = 0x8e,
53250397Sobrien    DW_OP_breg31 = 0x8f,
53350397Sobrien    DW_OP_regx = 0x90,
53450397Sobrien    DW_OP_fbreg = 0x91,
53550397Sobrien    DW_OP_bregx = 0x92,
53650397Sobrien    DW_OP_piece = 0x93,
53750397Sobrien    DW_OP_deref_size = 0x94,
53850397Sobrien    DW_OP_xderef_size = 0x95,
53990075Sobrien    DW_OP_nop = 0x96,
54090075Sobrien    /* DWARF 3 extensions.  */
54190075Sobrien    DW_OP_push_object_address = 0x97,
54290075Sobrien    DW_OP_call2 = 0x98,
54390075Sobrien    DW_OP_call4 = 0x99,
544117395Skan    DW_OP_call_ref = 0x9a,
545169689Skan    DW_OP_form_tls_address = 0x9b,
546169689Skan    DW_OP_call_frame_cfa = 0x9c,
547169689Skan    DW_OP_bit_piece = 0x9d,
548117395Skan    /* GNU extensions.  */
549169689Skan    DW_OP_GNU_push_tls_address = 0xe0,
550169689Skan    /* HP extensions.  */
551169689Skan    DW_OP_HP_unknown     = 0xe0, /* Ouch, the same as GNU_push_tls_address.  */
552169689Skan    DW_OP_HP_is_value    = 0xe1,
553169689Skan    DW_OP_HP_fltconst4   = 0xe2,
554169689Skan    DW_OP_HP_fltconst8   = 0xe3,
555169689Skan    DW_OP_HP_mod_range   = 0xe4,
556169689Skan    DW_OP_HP_unmod_range = 0xe5,
557169689Skan    DW_OP_HP_tls         = 0xe6
55850397Sobrien  };
55950397Sobrien
560117395Skan#define DW_OP_lo_user	0xe0	/* Implementation-defined range start.  */
56190075Sobrien#define DW_OP_hi_user	0xff	/* Implementation-defined range end.  */
56250397Sobrien
56350397Sobrien/* Type encodings.  */
56450397Sobrienenum dwarf_type
56550397Sobrien  {
56650397Sobrien    DW_ATE_void = 0x0,
56750397Sobrien    DW_ATE_address = 0x1,
56850397Sobrien    DW_ATE_boolean = 0x2,
56950397Sobrien    DW_ATE_complex_float = 0x3,
57050397Sobrien    DW_ATE_float = 0x4,
57150397Sobrien    DW_ATE_signed = 0x5,
57250397Sobrien    DW_ATE_signed_char = 0x6,
57350397Sobrien    DW_ATE_unsigned = 0x7,
57490075Sobrien    DW_ATE_unsigned_char = 0x8,
57590075Sobrien    /* DWARF 3.  */
576169689Skan    DW_ATE_imaginary_float = 0x9,
577169689Skan    DW_ATE_packed_decimal = 0xa,
578169689Skan    DW_ATE_numeric_string = 0xb,
579169689Skan    DW_ATE_edited = 0xc,
580169689Skan    DW_ATE_signed_fixed = 0xd,
581169689Skan    DW_ATE_unsigned_fixed = 0xe,
582169689Skan    DW_ATE_decimal_float = 0xf,
583169689Skan    /* HP extensions.  */
584169689Skan    DW_ATE_HP_float80            = 0x80, /* Floating-point (80 bit).  */
585169689Skan    DW_ATE_HP_complex_float80    = 0x81, /* Complex floating-point (80 bit).  */
586169689Skan    DW_ATE_HP_float128           = 0x82, /* Floating-point (128 bit).  */
587169689Skan    DW_ATE_HP_complex_float128   = 0x83, /* Complex floating-point (128 bit).  */
588169689Skan    DW_ATE_HP_floathpintel       = 0x84, /* Floating-point (82 bit IA64).  */
589169689Skan    DW_ATE_HP_imaginary_float80  = 0x85,
590169689Skan    DW_ATE_HP_imaginary_float128 = 0x86
59150397Sobrien  };
59250397Sobrien
59350397Sobrien#define	DW_ATE_lo_user 0x80
59450397Sobrien#define	DW_ATE_hi_user 0xff
59550397Sobrien
596169689Skan/* Decimal sign encodings.  */
597169689Skanenum dwarf_decimal_sign_encoding
598169689Skan  {
599169689Skan    /* DWARF 3.  */
600169689Skan    DW_DS_unsigned = 0x01,
601169689Skan    DW_DS_leading_overpunch = 0x02,
602169689Skan    DW_DS_trailing_overpunch = 0x03,
603169689Skan    DW_DS_leading_separate = 0x04,
604169689Skan    DW_DS_trailing_separate = 0x05
605169689Skan  };
606169689Skan
607169689Skan/* Endianity encodings.  */
608169689Skanenum dwarf_endianity_encoding
609169689Skan  {
610169689Skan    /* DWARF 3.  */
611169689Skan    DW_END_default = 0x00,
612169689Skan    DW_END_big = 0x01,
613169689Skan    DW_END_little = 0x02
614169689Skan  };
615169689Skan
616169689Skan#define DW_END_lo_user 0x40
617169689Skan#define DW_END_hi_user 0xff
618169689Skan
61950397Sobrien/* Array ordering names and codes.  */
62050397Sobrienenum dwarf_array_dim_ordering
62150397Sobrien  {
62250397Sobrien    DW_ORD_row_major = 0,
62350397Sobrien    DW_ORD_col_major = 1
62450397Sobrien  };
62550397Sobrien
62690075Sobrien/* Access attribute.  */
62750397Sobrienenum dwarf_access_attribute
62850397Sobrien  {
62950397Sobrien    DW_ACCESS_public = 1,
63050397Sobrien    DW_ACCESS_protected = 2,
63150397Sobrien    DW_ACCESS_private = 3
63250397Sobrien  };
63350397Sobrien
63490075Sobrien/* Visibility.  */
63550397Sobrienenum dwarf_visibility_attribute
63650397Sobrien  {
63750397Sobrien    DW_VIS_local = 1,
63850397Sobrien    DW_VIS_exported = 2,
63950397Sobrien    DW_VIS_qualified = 3
64050397Sobrien  };
64150397Sobrien
64290075Sobrien/* Virtuality.  */
64350397Sobrienenum dwarf_virtuality_attribute
64450397Sobrien  {
64550397Sobrien    DW_VIRTUALITY_none = 0,
64650397Sobrien    DW_VIRTUALITY_virtual = 1,
64750397Sobrien    DW_VIRTUALITY_pure_virtual = 2
64850397Sobrien  };
64950397Sobrien
65090075Sobrien/* Case sensitivity.  */
65150397Sobrienenum dwarf_id_case
65250397Sobrien  {
65350397Sobrien    DW_ID_case_sensitive = 0,
65450397Sobrien    DW_ID_up_case = 1,
65550397Sobrien    DW_ID_down_case = 2,
65650397Sobrien    DW_ID_case_insensitive = 3
65750397Sobrien  };
65850397Sobrien
65990075Sobrien/* Calling convention.  */
66050397Sobrienenum dwarf_calling_convention
66150397Sobrien  {
66250397Sobrien    DW_CC_normal = 0x1,
66350397Sobrien    DW_CC_program = 0x2,
664169689Skan    DW_CC_nocall = 0x3,
665169689Skan    DW_CC_GNU_renesas_sh = 0x40
66650397Sobrien  };
66750397Sobrien
66850397Sobrien#define DW_CC_lo_user 0x40
66950397Sobrien#define DW_CC_hi_user 0xff
67050397Sobrien
67190075Sobrien/* Inline attribute.  */
67250397Sobrienenum dwarf_inline_attribute
67350397Sobrien  {
67450397Sobrien    DW_INL_not_inlined = 0,
67550397Sobrien    DW_INL_inlined = 1,
67650397Sobrien    DW_INL_declared_not_inlined = 2,
67750397Sobrien    DW_INL_declared_inlined = 3
67850397Sobrien  };
67950397Sobrien
68090075Sobrien/* Discriminant lists.  */
68150397Sobrienenum dwarf_discrim_list
68250397Sobrien  {
68350397Sobrien    DW_DSC_label = 0,
68450397Sobrien    DW_DSC_range = 1
68550397Sobrien  };
68650397Sobrien
68790075Sobrien/* Line number opcodes.  */
68850397Sobrienenum dwarf_line_number_ops
68950397Sobrien  {
69050397Sobrien    DW_LNS_extended_op = 0,
69150397Sobrien    DW_LNS_copy = 1,
69250397Sobrien    DW_LNS_advance_pc = 2,
69350397Sobrien    DW_LNS_advance_line = 3,
69450397Sobrien    DW_LNS_set_file = 4,
69550397Sobrien    DW_LNS_set_column = 5,
69650397Sobrien    DW_LNS_negate_stmt = 6,
69750397Sobrien    DW_LNS_set_basic_block = 7,
69850397Sobrien    DW_LNS_const_add_pc = 8,
69990075Sobrien    DW_LNS_fixed_advance_pc = 9,
70090075Sobrien    /* DWARF 3.  */
70190075Sobrien    DW_LNS_set_prologue_end = 10,
70290075Sobrien    DW_LNS_set_epilogue_begin = 11,
70390075Sobrien    DW_LNS_set_isa = 12
70450397Sobrien  };
70550397Sobrien
70690075Sobrien/* Line number extended opcodes.  */
70750397Sobrienenum dwarf_line_number_x_ops
70850397Sobrien  {
70950397Sobrien    DW_LNE_end_sequence = 1,
71050397Sobrien    DW_LNE_set_address = 2,
711169689Skan    DW_LNE_define_file = 3,
712169689Skan    /* HP extensions.  */
713169689Skan    DW_LNE_HP_negate_is_UV_update      = 0x11,
714169689Skan    DW_LNE_HP_push_context             = 0x12,
715169689Skan    DW_LNE_HP_pop_context              = 0x13,
716169689Skan    DW_LNE_HP_set_file_line_column     = 0x14,
717169689Skan    DW_LNE_HP_set_routine_name         = 0x15,
718169689Skan    DW_LNE_HP_set_sequence             = 0x16,
719169689Skan    DW_LNE_HP_negate_post_semantics    = 0x17,
720169689Skan    DW_LNE_HP_negate_function_exit     = 0x18,
721169689Skan    DW_LNE_HP_negate_front_end_logical = 0x19,
722169689Skan    DW_LNE_HP_define_proc              = 0x20
72350397Sobrien  };
72450397Sobrien
725169689Skan#define DW_LNE_lo_user 0x80
726169689Skan#define DW_LNE_hi_user 0xff
727169689Skan
72890075Sobrien/* Call frame information.  */
72950397Sobrienenum dwarf_call_frame_info
73050397Sobrien  {
73150397Sobrien    DW_CFA_advance_loc = 0x40,
73250397Sobrien    DW_CFA_offset = 0x80,
73350397Sobrien    DW_CFA_restore = 0xc0,
73450397Sobrien    DW_CFA_nop = 0x00,
73550397Sobrien    DW_CFA_set_loc = 0x01,
73650397Sobrien    DW_CFA_advance_loc1 = 0x02,
73750397Sobrien    DW_CFA_advance_loc2 = 0x03,
73850397Sobrien    DW_CFA_advance_loc4 = 0x04,
73950397Sobrien    DW_CFA_offset_extended = 0x05,
74050397Sobrien    DW_CFA_restore_extended = 0x06,
74150397Sobrien    DW_CFA_undefined = 0x07,
74250397Sobrien    DW_CFA_same_value = 0x08,
74350397Sobrien    DW_CFA_register = 0x09,
74450397Sobrien    DW_CFA_remember_state = 0x0a,
74550397Sobrien    DW_CFA_restore_state = 0x0b,
74650397Sobrien    DW_CFA_def_cfa = 0x0c,
74750397Sobrien    DW_CFA_def_cfa_register = 0x0d,
74850397Sobrien    DW_CFA_def_cfa_offset = 0x0e,
74990075Sobrien    /* DWARF 3.  */
75090075Sobrien    DW_CFA_def_cfa_expression = 0x0f,
75190075Sobrien    DW_CFA_expression = 0x10,
75290075Sobrien    DW_CFA_offset_extended_sf = 0x11,
75390075Sobrien    DW_CFA_def_cfa_sf = 0x12,
75490075Sobrien    DW_CFA_def_cfa_offset_sf = 0x13,
755169689Skan    DW_CFA_val_offset = 0x14,
756169689Skan    DW_CFA_val_offset_sf = 0x15,
757169689Skan    DW_CFA_val_expression = 0x16,
75890075Sobrien    /* SGI/MIPS specific.  */
75950397Sobrien    DW_CFA_MIPS_advance_loc8 = 0x1d,
76090075Sobrien    /* GNU extensions.  */
76150397Sobrien    DW_CFA_GNU_window_save = 0x2d,
76270635Sobrien    DW_CFA_GNU_args_size = 0x2e,
76370635Sobrien    DW_CFA_GNU_negative_offset_extended = 0x2f
76450397Sobrien  };
76550397Sobrien
76650397Sobrien#define DW_CIE_ID	  0xffffffff
767169689Skan#define DW64_CIE_ID	  0xffffffffffffffffULL
76850397Sobrien#define DW_CIE_VERSION	  1
76950397Sobrien
77050397Sobrien#define DW_CFA_extended   0
771169689Skan#define DW_CFA_lo_user    0x1c
772169689Skan#define DW_CFA_hi_user    0x3f
77350397Sobrien
77450397Sobrien#define DW_CHILDREN_no		     0x00
77550397Sobrien#define DW_CHILDREN_yes		     0x01
77650397Sobrien
77750397Sobrien#define DW_ADDR_none		0
77850397Sobrien
77950397Sobrien/* Source language names and codes.  */
78050397Sobrienenum dwarf_source_language
78150397Sobrien  {
78250397Sobrien    DW_LANG_C89 = 0x0001,
78350397Sobrien    DW_LANG_C = 0x0002,
78450397Sobrien    DW_LANG_Ada83 = 0x0003,
78550397Sobrien    DW_LANG_C_plus_plus = 0x0004,
78650397Sobrien    DW_LANG_Cobol74 = 0x0005,
78750397Sobrien    DW_LANG_Cobol85 = 0x0006,
78850397Sobrien    DW_LANG_Fortran77 = 0x0007,
78950397Sobrien    DW_LANG_Fortran90 = 0x0008,
79050397Sobrien    DW_LANG_Pascal83 = 0x0009,
79150397Sobrien    DW_LANG_Modula2 = 0x000a,
792169689Skan    /* DWARF 3.  */
79390075Sobrien    DW_LANG_Java = 0x000b,
79490075Sobrien    DW_LANG_C99 = 0x000c,
79590075Sobrien    DW_LANG_Ada95 = 0x000d,
79690075Sobrien    DW_LANG_Fortran95 = 0x000e,
797169689Skan    DW_LANG_PLI = 0x000f,
798169689Skan    DW_LANG_ObjC = 0x0010,
799169689Skan    DW_LANG_ObjC_plus_plus = 0x0011,
800169689Skan    DW_LANG_UPC = 0x0012,
801169689Skan    DW_LANG_D = 0x0013,
80290075Sobrien    /* MIPS.  */
803169689Skan    DW_LANG_Mips_Assembler = 0x8001,
804169689Skan    /* UPC.  */
805169689Skan    DW_LANG_Upc = 0x8765
80650397Sobrien  };
80750397Sobrien
80890075Sobrien#define DW_LANG_lo_user 0x8000	/* Implementation-defined range start.  */
80990075Sobrien#define DW_LANG_hi_user 0xffff	/* Implementation-defined range start.  */
81050397Sobrien
81150397Sobrien/* Names and codes for macro information.  */
81250397Sobrienenum dwarf_macinfo_record_type
81350397Sobrien  {
81450397Sobrien    DW_MACINFO_define = 1,
81550397Sobrien    DW_MACINFO_undef = 2,
81650397Sobrien    DW_MACINFO_start_file = 3,
81750397Sobrien    DW_MACINFO_end_file = 4,
81850397Sobrien    DW_MACINFO_vendor_ext = 255
81950397Sobrien  };
82090075Sobrien
82190075Sobrien/* @@@ For use with GNU frame unwind information.  */
82290075Sobrien
82390075Sobrien#define DW_EH_PE_absptr		0x00
82490075Sobrien#define DW_EH_PE_omit		0xff
82590075Sobrien
82690075Sobrien#define DW_EH_PE_uleb128	0x01
82790075Sobrien#define DW_EH_PE_udata2		0x02
82890075Sobrien#define DW_EH_PE_udata4		0x03
82990075Sobrien#define DW_EH_PE_udata8		0x04
83090075Sobrien#define DW_EH_PE_sleb128	0x09
83190075Sobrien#define DW_EH_PE_sdata2		0x0A
83290075Sobrien#define DW_EH_PE_sdata4		0x0B
83390075Sobrien#define DW_EH_PE_sdata8		0x0C
83490075Sobrien#define DW_EH_PE_signed		0x08
83590075Sobrien
83690075Sobrien#define DW_EH_PE_pcrel		0x10
83790075Sobrien#define DW_EH_PE_textrel	0x20
83890075Sobrien#define DW_EH_PE_datarel	0x30
83990075Sobrien#define DW_EH_PE_funcrel	0x40
84090075Sobrien#define DW_EH_PE_aligned	0x50
84190075Sobrien
84290075Sobrien#define DW_EH_PE_indirect	0x80
843132718Skan
844132718Skan#endif /* dwarf2.h */
845