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,
379169689Skan    DW_AT_PGI_lstride  = 0x3a02
38050397Sobrien  };
38150397Sobrien
38290075Sobrien#define DW_AT_lo_user	0x2000	/* Implementation-defined range start.  */
38390075Sobrien#define DW_AT_hi_user	0x3ff0	/* Implementation-defined range end.  */
38450397Sobrien
38550397Sobrien/* Location atom names and codes.  */
38650397Sobrienenum dwarf_location_atom
38750397Sobrien  {
38850397Sobrien    DW_OP_addr = 0x03,
38950397Sobrien    DW_OP_deref = 0x06,
39050397Sobrien    DW_OP_const1u = 0x08,
39150397Sobrien    DW_OP_const1s = 0x09,
39250397Sobrien    DW_OP_const2u = 0x0a,
39350397Sobrien    DW_OP_const2s = 0x0b,
39450397Sobrien    DW_OP_const4u = 0x0c,
39550397Sobrien    DW_OP_const4s = 0x0d,
39650397Sobrien    DW_OP_const8u = 0x0e,
39750397Sobrien    DW_OP_const8s = 0x0f,
39850397Sobrien    DW_OP_constu = 0x10,
39950397Sobrien    DW_OP_consts = 0x11,
40050397Sobrien    DW_OP_dup = 0x12,
40150397Sobrien    DW_OP_drop = 0x13,
40250397Sobrien    DW_OP_over = 0x14,
40350397Sobrien    DW_OP_pick = 0x15,
40450397Sobrien    DW_OP_swap = 0x16,
40550397Sobrien    DW_OP_rot = 0x17,
40650397Sobrien    DW_OP_xderef = 0x18,
40750397Sobrien    DW_OP_abs = 0x19,
40850397Sobrien    DW_OP_and = 0x1a,
40950397Sobrien    DW_OP_div = 0x1b,
41050397Sobrien    DW_OP_minus = 0x1c,
41150397Sobrien    DW_OP_mod = 0x1d,
41250397Sobrien    DW_OP_mul = 0x1e,
41350397Sobrien    DW_OP_neg = 0x1f,
41450397Sobrien    DW_OP_not = 0x20,
41550397Sobrien    DW_OP_or = 0x21,
41650397Sobrien    DW_OP_plus = 0x22,
41750397Sobrien    DW_OP_plus_uconst = 0x23,
41850397Sobrien    DW_OP_shl = 0x24,
41950397Sobrien    DW_OP_shr = 0x25,
42050397Sobrien    DW_OP_shra = 0x26,
42150397Sobrien    DW_OP_xor = 0x27,
42250397Sobrien    DW_OP_bra = 0x28,
42350397Sobrien    DW_OP_eq = 0x29,
42450397Sobrien    DW_OP_ge = 0x2a,
42550397Sobrien    DW_OP_gt = 0x2b,
42650397Sobrien    DW_OP_le = 0x2c,
42750397Sobrien    DW_OP_lt = 0x2d,
42850397Sobrien    DW_OP_ne = 0x2e,
42950397Sobrien    DW_OP_skip = 0x2f,
43050397Sobrien    DW_OP_lit0 = 0x30,
43150397Sobrien    DW_OP_lit1 = 0x31,
43250397Sobrien    DW_OP_lit2 = 0x32,
43350397Sobrien    DW_OP_lit3 = 0x33,
43450397Sobrien    DW_OP_lit4 = 0x34,
43550397Sobrien    DW_OP_lit5 = 0x35,
43650397Sobrien    DW_OP_lit6 = 0x36,
43750397Sobrien    DW_OP_lit7 = 0x37,
43850397Sobrien    DW_OP_lit8 = 0x38,
43950397Sobrien    DW_OP_lit9 = 0x39,
44050397Sobrien    DW_OP_lit10 = 0x3a,
44150397Sobrien    DW_OP_lit11 = 0x3b,
44250397Sobrien    DW_OP_lit12 = 0x3c,
44350397Sobrien    DW_OP_lit13 = 0x3d,
44450397Sobrien    DW_OP_lit14 = 0x3e,
44550397Sobrien    DW_OP_lit15 = 0x3f,
44650397Sobrien    DW_OP_lit16 = 0x40,
44750397Sobrien    DW_OP_lit17 = 0x41,
44850397Sobrien    DW_OP_lit18 = 0x42,
44950397Sobrien    DW_OP_lit19 = 0x43,
45050397Sobrien    DW_OP_lit20 = 0x44,
45150397Sobrien    DW_OP_lit21 = 0x45,
45250397Sobrien    DW_OP_lit22 = 0x46,
45350397Sobrien    DW_OP_lit23 = 0x47,
45450397Sobrien    DW_OP_lit24 = 0x48,
45550397Sobrien    DW_OP_lit25 = 0x49,
45650397Sobrien    DW_OP_lit26 = 0x4a,
45750397Sobrien    DW_OP_lit27 = 0x4b,
45850397Sobrien    DW_OP_lit28 = 0x4c,
45950397Sobrien    DW_OP_lit29 = 0x4d,
46050397Sobrien    DW_OP_lit30 = 0x4e,
46150397Sobrien    DW_OP_lit31 = 0x4f,
46250397Sobrien    DW_OP_reg0 = 0x50,
46350397Sobrien    DW_OP_reg1 = 0x51,
46450397Sobrien    DW_OP_reg2 = 0x52,
46550397Sobrien    DW_OP_reg3 = 0x53,
46650397Sobrien    DW_OP_reg4 = 0x54,
46750397Sobrien    DW_OP_reg5 = 0x55,
46850397Sobrien    DW_OP_reg6 = 0x56,
46950397Sobrien    DW_OP_reg7 = 0x57,
47050397Sobrien    DW_OP_reg8 = 0x58,
47150397Sobrien    DW_OP_reg9 = 0x59,
47250397Sobrien    DW_OP_reg10 = 0x5a,
47350397Sobrien    DW_OP_reg11 = 0x5b,
47450397Sobrien    DW_OP_reg12 = 0x5c,
47550397Sobrien    DW_OP_reg13 = 0x5d,
47650397Sobrien    DW_OP_reg14 = 0x5e,
47750397Sobrien    DW_OP_reg15 = 0x5f,
47850397Sobrien    DW_OP_reg16 = 0x60,
47950397Sobrien    DW_OP_reg17 = 0x61,
48050397Sobrien    DW_OP_reg18 = 0x62,
48150397Sobrien    DW_OP_reg19 = 0x63,
48250397Sobrien    DW_OP_reg20 = 0x64,
48350397Sobrien    DW_OP_reg21 = 0x65,
48450397Sobrien    DW_OP_reg22 = 0x66,
48550397Sobrien    DW_OP_reg23 = 0x67,
48650397Sobrien    DW_OP_reg24 = 0x68,
48750397Sobrien    DW_OP_reg25 = 0x69,
48850397Sobrien    DW_OP_reg26 = 0x6a,
48950397Sobrien    DW_OP_reg27 = 0x6b,
49050397Sobrien    DW_OP_reg28 = 0x6c,
49150397Sobrien    DW_OP_reg29 = 0x6d,
49250397Sobrien    DW_OP_reg30 = 0x6e,
49350397Sobrien    DW_OP_reg31 = 0x6f,
49450397Sobrien    DW_OP_breg0 = 0x70,
49550397Sobrien    DW_OP_breg1 = 0x71,
49650397Sobrien    DW_OP_breg2 = 0x72,
49750397Sobrien    DW_OP_breg3 = 0x73,
49850397Sobrien    DW_OP_breg4 = 0x74,
49950397Sobrien    DW_OP_breg5 = 0x75,
50050397Sobrien    DW_OP_breg6 = 0x76,
50150397Sobrien    DW_OP_breg7 = 0x77,
50250397Sobrien    DW_OP_breg8 = 0x78,
50350397Sobrien    DW_OP_breg9 = 0x79,
50450397Sobrien    DW_OP_breg10 = 0x7a,
50550397Sobrien    DW_OP_breg11 = 0x7b,
50650397Sobrien    DW_OP_breg12 = 0x7c,
50750397Sobrien    DW_OP_breg13 = 0x7d,
50850397Sobrien    DW_OP_breg14 = 0x7e,
50950397Sobrien    DW_OP_breg15 = 0x7f,
51050397Sobrien    DW_OP_breg16 = 0x80,
51150397Sobrien    DW_OP_breg17 = 0x81,
51250397Sobrien    DW_OP_breg18 = 0x82,
51350397Sobrien    DW_OP_breg19 = 0x83,
51450397Sobrien    DW_OP_breg20 = 0x84,
51550397Sobrien    DW_OP_breg21 = 0x85,
51650397Sobrien    DW_OP_breg22 = 0x86,
51750397Sobrien    DW_OP_breg23 = 0x87,
51850397Sobrien    DW_OP_breg24 = 0x88,
51950397Sobrien    DW_OP_breg25 = 0x89,
52050397Sobrien    DW_OP_breg26 = 0x8a,
52150397Sobrien    DW_OP_breg27 = 0x8b,
52250397Sobrien    DW_OP_breg28 = 0x8c,
52350397Sobrien    DW_OP_breg29 = 0x8d,
52450397Sobrien    DW_OP_breg30 = 0x8e,
52550397Sobrien    DW_OP_breg31 = 0x8f,
52650397Sobrien    DW_OP_regx = 0x90,
52750397Sobrien    DW_OP_fbreg = 0x91,
52850397Sobrien    DW_OP_bregx = 0x92,
52950397Sobrien    DW_OP_piece = 0x93,
53050397Sobrien    DW_OP_deref_size = 0x94,
53150397Sobrien    DW_OP_xderef_size = 0x95,
53290075Sobrien    DW_OP_nop = 0x96,
53390075Sobrien    /* DWARF 3 extensions.  */
53490075Sobrien    DW_OP_push_object_address = 0x97,
53590075Sobrien    DW_OP_call2 = 0x98,
53690075Sobrien    DW_OP_call4 = 0x99,
537117395Skan    DW_OP_call_ref = 0x9a,
538169689Skan    DW_OP_form_tls_address = 0x9b,
539169689Skan    DW_OP_call_frame_cfa = 0x9c,
540169689Skan    DW_OP_bit_piece = 0x9d,
541117395Skan    /* GNU extensions.  */
542169689Skan    DW_OP_GNU_push_tls_address = 0xe0,
543169689Skan    /* HP extensions.  */
544169689Skan    DW_OP_HP_unknown     = 0xe0, /* Ouch, the same as GNU_push_tls_address.  */
545169689Skan    DW_OP_HP_is_value    = 0xe1,
546169689Skan    DW_OP_HP_fltconst4   = 0xe2,
547169689Skan    DW_OP_HP_fltconst8   = 0xe3,
548169689Skan    DW_OP_HP_mod_range   = 0xe4,
549169689Skan    DW_OP_HP_unmod_range = 0xe5,
550169689Skan    DW_OP_HP_tls         = 0xe6
55150397Sobrien  };
55250397Sobrien
553117395Skan#define DW_OP_lo_user	0xe0	/* Implementation-defined range start.  */
55490075Sobrien#define DW_OP_hi_user	0xff	/* Implementation-defined range end.  */
55550397Sobrien
55650397Sobrien/* Type encodings.  */
55750397Sobrienenum dwarf_type
55850397Sobrien  {
55950397Sobrien    DW_ATE_void = 0x0,
56050397Sobrien    DW_ATE_address = 0x1,
56150397Sobrien    DW_ATE_boolean = 0x2,
56250397Sobrien    DW_ATE_complex_float = 0x3,
56350397Sobrien    DW_ATE_float = 0x4,
56450397Sobrien    DW_ATE_signed = 0x5,
56550397Sobrien    DW_ATE_signed_char = 0x6,
56650397Sobrien    DW_ATE_unsigned = 0x7,
56790075Sobrien    DW_ATE_unsigned_char = 0x8,
56890075Sobrien    /* DWARF 3.  */
569169689Skan    DW_ATE_imaginary_float = 0x9,
570169689Skan    DW_ATE_packed_decimal = 0xa,
571169689Skan    DW_ATE_numeric_string = 0xb,
572169689Skan    DW_ATE_edited = 0xc,
573169689Skan    DW_ATE_signed_fixed = 0xd,
574169689Skan    DW_ATE_unsigned_fixed = 0xe,
575169689Skan    DW_ATE_decimal_float = 0xf,
576169689Skan    /* HP extensions.  */
577169689Skan    DW_ATE_HP_float80            = 0x80, /* Floating-point (80 bit).  */
578169689Skan    DW_ATE_HP_complex_float80    = 0x81, /* Complex floating-point (80 bit).  */
579169689Skan    DW_ATE_HP_float128           = 0x82, /* Floating-point (128 bit).  */
580169689Skan    DW_ATE_HP_complex_float128   = 0x83, /* Complex floating-point (128 bit).  */
581169689Skan    DW_ATE_HP_floathpintel       = 0x84, /* Floating-point (82 bit IA64).  */
582169689Skan    DW_ATE_HP_imaginary_float80  = 0x85,
583169689Skan    DW_ATE_HP_imaginary_float128 = 0x86
58450397Sobrien  };
58550397Sobrien
58650397Sobrien#define	DW_ATE_lo_user 0x80
58750397Sobrien#define	DW_ATE_hi_user 0xff
58850397Sobrien
589169689Skan/* Decimal sign encodings.  */
590169689Skanenum dwarf_decimal_sign_encoding
591169689Skan  {
592169689Skan    /* DWARF 3.  */
593169689Skan    DW_DS_unsigned = 0x01,
594169689Skan    DW_DS_leading_overpunch = 0x02,
595169689Skan    DW_DS_trailing_overpunch = 0x03,
596169689Skan    DW_DS_leading_separate = 0x04,
597169689Skan    DW_DS_trailing_separate = 0x05
598169689Skan  };
599169689Skan
600169689Skan/* Endianity encodings.  */
601169689Skanenum dwarf_endianity_encoding
602169689Skan  {
603169689Skan    /* DWARF 3.  */
604169689Skan    DW_END_default = 0x00,
605169689Skan    DW_END_big = 0x01,
606169689Skan    DW_END_little = 0x02
607169689Skan  };
608169689Skan
609169689Skan#define DW_END_lo_user 0x40
610169689Skan#define DW_END_hi_user 0xff
611169689Skan
61250397Sobrien/* Array ordering names and codes.  */
61350397Sobrienenum dwarf_array_dim_ordering
61450397Sobrien  {
61550397Sobrien    DW_ORD_row_major = 0,
61650397Sobrien    DW_ORD_col_major = 1
61750397Sobrien  };
61850397Sobrien
61990075Sobrien/* Access attribute.  */
62050397Sobrienenum dwarf_access_attribute
62150397Sobrien  {
62250397Sobrien    DW_ACCESS_public = 1,
62350397Sobrien    DW_ACCESS_protected = 2,
62450397Sobrien    DW_ACCESS_private = 3
62550397Sobrien  };
62650397Sobrien
62790075Sobrien/* Visibility.  */
62850397Sobrienenum dwarf_visibility_attribute
62950397Sobrien  {
63050397Sobrien    DW_VIS_local = 1,
63150397Sobrien    DW_VIS_exported = 2,
63250397Sobrien    DW_VIS_qualified = 3
63350397Sobrien  };
63450397Sobrien
63590075Sobrien/* Virtuality.  */
63650397Sobrienenum dwarf_virtuality_attribute
63750397Sobrien  {
63850397Sobrien    DW_VIRTUALITY_none = 0,
63950397Sobrien    DW_VIRTUALITY_virtual = 1,
64050397Sobrien    DW_VIRTUALITY_pure_virtual = 2
64150397Sobrien  };
64250397Sobrien
64390075Sobrien/* Case sensitivity.  */
64450397Sobrienenum dwarf_id_case
64550397Sobrien  {
64650397Sobrien    DW_ID_case_sensitive = 0,
64750397Sobrien    DW_ID_up_case = 1,
64850397Sobrien    DW_ID_down_case = 2,
64950397Sobrien    DW_ID_case_insensitive = 3
65050397Sobrien  };
65150397Sobrien
65290075Sobrien/* Calling convention.  */
65350397Sobrienenum dwarf_calling_convention
65450397Sobrien  {
65550397Sobrien    DW_CC_normal = 0x1,
65650397Sobrien    DW_CC_program = 0x2,
657169689Skan    DW_CC_nocall = 0x3,
658169689Skan    DW_CC_GNU_renesas_sh = 0x40
65950397Sobrien  };
66050397Sobrien
66150397Sobrien#define DW_CC_lo_user 0x40
66250397Sobrien#define DW_CC_hi_user 0xff
66350397Sobrien
66490075Sobrien/* Inline attribute.  */
66550397Sobrienenum dwarf_inline_attribute
66650397Sobrien  {
66750397Sobrien    DW_INL_not_inlined = 0,
66850397Sobrien    DW_INL_inlined = 1,
66950397Sobrien    DW_INL_declared_not_inlined = 2,
67050397Sobrien    DW_INL_declared_inlined = 3
67150397Sobrien  };
67250397Sobrien
67390075Sobrien/* Discriminant lists.  */
67450397Sobrienenum dwarf_discrim_list
67550397Sobrien  {
67650397Sobrien    DW_DSC_label = 0,
67750397Sobrien    DW_DSC_range = 1
67850397Sobrien  };
67950397Sobrien
68090075Sobrien/* Line number opcodes.  */
68150397Sobrienenum dwarf_line_number_ops
68250397Sobrien  {
68350397Sobrien    DW_LNS_extended_op = 0,
68450397Sobrien    DW_LNS_copy = 1,
68550397Sobrien    DW_LNS_advance_pc = 2,
68650397Sobrien    DW_LNS_advance_line = 3,
68750397Sobrien    DW_LNS_set_file = 4,
68850397Sobrien    DW_LNS_set_column = 5,
68950397Sobrien    DW_LNS_negate_stmt = 6,
69050397Sobrien    DW_LNS_set_basic_block = 7,
69150397Sobrien    DW_LNS_const_add_pc = 8,
69290075Sobrien    DW_LNS_fixed_advance_pc = 9,
69390075Sobrien    /* DWARF 3.  */
69490075Sobrien    DW_LNS_set_prologue_end = 10,
69590075Sobrien    DW_LNS_set_epilogue_begin = 11,
69690075Sobrien    DW_LNS_set_isa = 12
69750397Sobrien  };
69850397Sobrien
69990075Sobrien/* Line number extended opcodes.  */
70050397Sobrienenum dwarf_line_number_x_ops
70150397Sobrien  {
70250397Sobrien    DW_LNE_end_sequence = 1,
70350397Sobrien    DW_LNE_set_address = 2,
704169689Skan    DW_LNE_define_file = 3,
705169689Skan    /* HP extensions.  */
706169689Skan    DW_LNE_HP_negate_is_UV_update      = 0x11,
707169689Skan    DW_LNE_HP_push_context             = 0x12,
708169689Skan    DW_LNE_HP_pop_context              = 0x13,
709169689Skan    DW_LNE_HP_set_file_line_column     = 0x14,
710169689Skan    DW_LNE_HP_set_routine_name         = 0x15,
711169689Skan    DW_LNE_HP_set_sequence             = 0x16,
712169689Skan    DW_LNE_HP_negate_post_semantics    = 0x17,
713169689Skan    DW_LNE_HP_negate_function_exit     = 0x18,
714169689Skan    DW_LNE_HP_negate_front_end_logical = 0x19,
715169689Skan    DW_LNE_HP_define_proc              = 0x20
71650397Sobrien  };
71750397Sobrien
718169689Skan#define DW_LNE_lo_user 0x80
719169689Skan#define DW_LNE_hi_user 0xff
720169689Skan
72190075Sobrien/* Call frame information.  */
72250397Sobrienenum dwarf_call_frame_info
72350397Sobrien  {
72450397Sobrien    DW_CFA_advance_loc = 0x40,
72550397Sobrien    DW_CFA_offset = 0x80,
72650397Sobrien    DW_CFA_restore = 0xc0,
72750397Sobrien    DW_CFA_nop = 0x00,
72850397Sobrien    DW_CFA_set_loc = 0x01,
72950397Sobrien    DW_CFA_advance_loc1 = 0x02,
73050397Sobrien    DW_CFA_advance_loc2 = 0x03,
73150397Sobrien    DW_CFA_advance_loc4 = 0x04,
73250397Sobrien    DW_CFA_offset_extended = 0x05,
73350397Sobrien    DW_CFA_restore_extended = 0x06,
73450397Sobrien    DW_CFA_undefined = 0x07,
73550397Sobrien    DW_CFA_same_value = 0x08,
73650397Sobrien    DW_CFA_register = 0x09,
73750397Sobrien    DW_CFA_remember_state = 0x0a,
73850397Sobrien    DW_CFA_restore_state = 0x0b,
73950397Sobrien    DW_CFA_def_cfa = 0x0c,
74050397Sobrien    DW_CFA_def_cfa_register = 0x0d,
74150397Sobrien    DW_CFA_def_cfa_offset = 0x0e,
74290075Sobrien    /* DWARF 3.  */
74390075Sobrien    DW_CFA_def_cfa_expression = 0x0f,
74490075Sobrien    DW_CFA_expression = 0x10,
74590075Sobrien    DW_CFA_offset_extended_sf = 0x11,
74690075Sobrien    DW_CFA_def_cfa_sf = 0x12,
74790075Sobrien    DW_CFA_def_cfa_offset_sf = 0x13,
748169689Skan    DW_CFA_val_offset = 0x14,
749169689Skan    DW_CFA_val_offset_sf = 0x15,
750169689Skan    DW_CFA_val_expression = 0x16,
75190075Sobrien    /* SGI/MIPS specific.  */
75250397Sobrien    DW_CFA_MIPS_advance_loc8 = 0x1d,
75390075Sobrien    /* GNU extensions.  */
75450397Sobrien    DW_CFA_GNU_window_save = 0x2d,
75570635Sobrien    DW_CFA_GNU_args_size = 0x2e,
75670635Sobrien    DW_CFA_GNU_negative_offset_extended = 0x2f
75750397Sobrien  };
75850397Sobrien
75950397Sobrien#define DW_CIE_ID	  0xffffffff
760169689Skan#define DW64_CIE_ID	  0xffffffffffffffffULL
76150397Sobrien#define DW_CIE_VERSION	  1
76250397Sobrien
76350397Sobrien#define DW_CFA_extended   0
764169689Skan#define DW_CFA_lo_user    0x1c
765169689Skan#define DW_CFA_hi_user    0x3f
76650397Sobrien
76750397Sobrien#define DW_CHILDREN_no		     0x00
76850397Sobrien#define DW_CHILDREN_yes		     0x01
76950397Sobrien
77050397Sobrien#define DW_ADDR_none		0
77150397Sobrien
77250397Sobrien/* Source language names and codes.  */
77350397Sobrienenum dwarf_source_language
77450397Sobrien  {
77550397Sobrien    DW_LANG_C89 = 0x0001,
77650397Sobrien    DW_LANG_C = 0x0002,
77750397Sobrien    DW_LANG_Ada83 = 0x0003,
77850397Sobrien    DW_LANG_C_plus_plus = 0x0004,
77950397Sobrien    DW_LANG_Cobol74 = 0x0005,
78050397Sobrien    DW_LANG_Cobol85 = 0x0006,
78150397Sobrien    DW_LANG_Fortran77 = 0x0007,
78250397Sobrien    DW_LANG_Fortran90 = 0x0008,
78350397Sobrien    DW_LANG_Pascal83 = 0x0009,
78450397Sobrien    DW_LANG_Modula2 = 0x000a,
785169689Skan    /* DWARF 3.  */
78690075Sobrien    DW_LANG_Java = 0x000b,
78790075Sobrien    DW_LANG_C99 = 0x000c,
78890075Sobrien    DW_LANG_Ada95 = 0x000d,
78990075Sobrien    DW_LANG_Fortran95 = 0x000e,
790169689Skan    DW_LANG_PLI = 0x000f,
791169689Skan    DW_LANG_ObjC = 0x0010,
792169689Skan    DW_LANG_ObjC_plus_plus = 0x0011,
793169689Skan    DW_LANG_UPC = 0x0012,
794169689Skan    DW_LANG_D = 0x0013,
79590075Sobrien    /* MIPS.  */
796169689Skan    DW_LANG_Mips_Assembler = 0x8001,
797169689Skan    /* UPC.  */
798169689Skan    DW_LANG_Upc = 0x8765
79950397Sobrien  };
80050397Sobrien
80190075Sobrien#define DW_LANG_lo_user 0x8000	/* Implementation-defined range start.  */
80290075Sobrien#define DW_LANG_hi_user 0xffff	/* Implementation-defined range start.  */
80350397Sobrien
80450397Sobrien/* Names and codes for macro information.  */
80550397Sobrienenum dwarf_macinfo_record_type
80650397Sobrien  {
80750397Sobrien    DW_MACINFO_define = 1,
80850397Sobrien    DW_MACINFO_undef = 2,
80950397Sobrien    DW_MACINFO_start_file = 3,
81050397Sobrien    DW_MACINFO_end_file = 4,
81150397Sobrien    DW_MACINFO_vendor_ext = 255
81250397Sobrien  };
81390075Sobrien
81490075Sobrien/* @@@ For use with GNU frame unwind information.  */
81590075Sobrien
81690075Sobrien#define DW_EH_PE_absptr		0x00
81790075Sobrien#define DW_EH_PE_omit		0xff
81890075Sobrien
81990075Sobrien#define DW_EH_PE_uleb128	0x01
82090075Sobrien#define DW_EH_PE_udata2		0x02
82190075Sobrien#define DW_EH_PE_udata4		0x03
82290075Sobrien#define DW_EH_PE_udata8		0x04
82390075Sobrien#define DW_EH_PE_sleb128	0x09
82490075Sobrien#define DW_EH_PE_sdata2		0x0A
82590075Sobrien#define DW_EH_PE_sdata4		0x0B
82690075Sobrien#define DW_EH_PE_sdata8		0x0C
82790075Sobrien#define DW_EH_PE_signed		0x08
82890075Sobrien
82990075Sobrien#define DW_EH_PE_pcrel		0x10
83090075Sobrien#define DW_EH_PE_textrel	0x20
83190075Sobrien#define DW_EH_PE_datarel	0x30
83290075Sobrien#define DW_EH_PE_funcrel	0x40
83390075Sobrien#define DW_EH_PE_aligned	0x50
83490075Sobrien
83590075Sobrien#define DW_EH_PE_indirect	0x80
836132718Skan
837132718Skan#endif /* dwarf2.h */
838