1218822Sdim/* Declarations and definitions of codes relating to the DWARF2 and 2218822Sdim DWARF3 symbolic debugging information formats. 3130561Sobrien Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 4218822Sdim 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 533965Sjdp 633965Sjdp Written by Gary Funck (gary@intrepid.com) The Ada Joint Program 7218822Sdim Office (AJPO), Florida State University and Silicon Graphics Inc. 833965Sjdp provided support for this effort -- June 21, 1995. 933965Sjdp 1033965Sjdp Derived from the DWARF 1 implementation written by Ron Guilmette 1133965Sjdp (rfg@netcom.com), November 1990. 1233965Sjdp 13130561Sobrien This file is part of GCC. 1433965Sjdp 15130561Sobrien GCC is free software; you can redistribute it and/or modify it under 16130561Sobrien the terms of the GNU General Public License as published by the Free 17130561Sobrien Software Foundation; either version 2, or (at your option) any later 18130561Sobrien version. 1933965Sjdp 20130561Sobrien GCC is distributed in the hope that it will be useful, but WITHOUT 21130561Sobrien ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 22130561Sobrien or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 23130561Sobrien License for more details. 2433965Sjdp 25130561Sobrien You should have received a copy of the GNU General Public License 26130561Sobrien along with GCC; see the file COPYING. If not, write to the Free 27218822Sdim Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 28218822Sdim 02110-1301, USA. */ 2933965Sjdp 3033965Sjdp/* This file is derived from the DWARF specification (a public document) 3133965Sjdp Revision 2.0.0 (July 27, 1993) developed by the UNIX International 3233965Sjdp Programming Languages Special Interest Group (UI/PLSIG) and distributed 3333965Sjdp by UNIX International. Copies of this specification are available from 3480016Sobrien UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054. 3533965Sjdp 3691041Sobrien This file also now contains definitions from the DWARF 3 specification. */ 3780016Sobrien 3880016Sobrien/* This file is shared between GCC and GDB, and should not contain 3980016Sobrien prototypes. */ 4080016Sobrien 4133965Sjdp#ifndef _ELF_DWARF2_H 4233965Sjdp#define _ELF_DWARF2_H 4333965Sjdp 4460484Sobrien/* Structure found in the .debug_line section. */ 4560484Sobrientypedef struct 4660484Sobrien{ 4760484Sobrien unsigned char li_length [4]; 4860484Sobrien unsigned char li_version [2]; 4960484Sobrien unsigned char li_prologue_length [4]; 5060484Sobrien unsigned char li_min_insn_length [1]; 5160484Sobrien unsigned char li_default_is_stmt [1]; 5260484Sobrien unsigned char li_line_base [1]; 5360484Sobrien unsigned char li_line_range [1]; 5460484Sobrien unsigned char li_opcode_base [1]; 5560484Sobrien} 5660484SobrienDWARF2_External_LineInfo; 5760484Sobrien 5860484Sobrientypedef struct 5960484Sobrien{ 6060484Sobrien unsigned long li_length; 6160484Sobrien unsigned short li_version; 6260484Sobrien unsigned int li_prologue_length; 6360484Sobrien unsigned char li_min_insn_length; 6460484Sobrien unsigned char li_default_is_stmt; 6560484Sobrien int li_line_base; 6660484Sobrien unsigned char li_line_range; 6760484Sobrien unsigned char li_opcode_base; 6860484Sobrien} 6960484SobrienDWARF2_Internal_LineInfo; 7060484Sobrien 7160484Sobrien/* Structure found in .debug_pubnames section. */ 7260484Sobrientypedef struct 7360484Sobrien{ 7460484Sobrien unsigned char pn_length [4]; 7560484Sobrien unsigned char pn_version [2]; 7660484Sobrien unsigned char pn_offset [4]; 7760484Sobrien unsigned char pn_size [4]; 7860484Sobrien} 7960484SobrienDWARF2_External_PubNames; 8060484Sobrien 8160484Sobrientypedef struct 8260484Sobrien{ 8360484Sobrien unsigned long pn_length; 8460484Sobrien unsigned short pn_version; 8560484Sobrien unsigned long pn_offset; 8660484Sobrien unsigned long pn_size; 8760484Sobrien} 8860484SobrienDWARF2_Internal_PubNames; 8960484Sobrien 90130561Sobrien/* Structure found in .debug_info section. */ 9160484Sobrientypedef struct 9260484Sobrien{ 9360484Sobrien unsigned char cu_length [4]; 9460484Sobrien unsigned char cu_version [2]; 9560484Sobrien unsigned char cu_abbrev_offset [4]; 9660484Sobrien unsigned char cu_pointer_size [1]; 9760484Sobrien} 9860484SobrienDWARF2_External_CompUnit; 9960484Sobrien 10060484Sobrientypedef struct 10160484Sobrien{ 10260484Sobrien unsigned long cu_length; 10360484Sobrien unsigned short cu_version; 10460484Sobrien unsigned long cu_abbrev_offset; 10560484Sobrien unsigned char cu_pointer_size; 10660484Sobrien} 10760484SobrienDWARF2_Internal_CompUnit; 10860484Sobrien 10960484Sobrientypedef struct 11060484Sobrien{ 11160484Sobrien unsigned char ar_length [4]; 11260484Sobrien unsigned char ar_version [2]; 11360484Sobrien unsigned char ar_info_offset [4]; 11460484Sobrien unsigned char ar_pointer_size [1]; 11560484Sobrien unsigned char ar_segment_size [1]; 11660484Sobrien} 11760484SobrienDWARF2_External_ARange; 11860484Sobrien 11960484Sobrientypedef struct 12060484Sobrien{ 12160484Sobrien unsigned long ar_length; 12260484Sobrien unsigned short ar_version; 12360484Sobrien unsigned long ar_info_offset; 12460484Sobrien unsigned char ar_pointer_size; 12560484Sobrien unsigned char ar_segment_size; 12660484Sobrien} 12760484SobrienDWARF2_Internal_ARange; 12860484Sobrien 12960484Sobrien 13033965Sjdp/* Tag names and codes. */ 13133965Sjdpenum dwarf_tag 13233965Sjdp { 13333965Sjdp DW_TAG_padding = 0x00, 13433965Sjdp DW_TAG_array_type = 0x01, 13533965Sjdp DW_TAG_class_type = 0x02, 13633965Sjdp DW_TAG_entry_point = 0x03, 13733965Sjdp DW_TAG_enumeration_type = 0x04, 13833965Sjdp DW_TAG_formal_parameter = 0x05, 13933965Sjdp DW_TAG_imported_declaration = 0x08, 14033965Sjdp DW_TAG_label = 0x0a, 14133965Sjdp DW_TAG_lexical_block = 0x0b, 14233965Sjdp DW_TAG_member = 0x0d, 14333965Sjdp DW_TAG_pointer_type = 0x0f, 14433965Sjdp DW_TAG_reference_type = 0x10, 14533965Sjdp DW_TAG_compile_unit = 0x11, 14633965Sjdp DW_TAG_string_type = 0x12, 14733965Sjdp DW_TAG_structure_type = 0x13, 14833965Sjdp DW_TAG_subroutine_type = 0x15, 14933965Sjdp DW_TAG_typedef = 0x16, 15033965Sjdp DW_TAG_union_type = 0x17, 15133965Sjdp DW_TAG_unspecified_parameters = 0x18, 15233965Sjdp DW_TAG_variant = 0x19, 15333965Sjdp DW_TAG_common_block = 0x1a, 15433965Sjdp DW_TAG_common_inclusion = 0x1b, 15533965Sjdp DW_TAG_inheritance = 0x1c, 15633965Sjdp DW_TAG_inlined_subroutine = 0x1d, 15733965Sjdp DW_TAG_module = 0x1e, 15833965Sjdp DW_TAG_ptr_to_member_type = 0x1f, 15933965Sjdp DW_TAG_set_type = 0x20, 16033965Sjdp DW_TAG_subrange_type = 0x21, 16133965Sjdp DW_TAG_with_stmt = 0x22, 16233965Sjdp DW_TAG_access_declaration = 0x23, 16333965Sjdp DW_TAG_base_type = 0x24, 16433965Sjdp DW_TAG_catch_block = 0x25, 16533965Sjdp DW_TAG_const_type = 0x26, 16633965Sjdp DW_TAG_constant = 0x27, 16733965Sjdp DW_TAG_enumerator = 0x28, 16833965Sjdp DW_TAG_file_type = 0x29, 16933965Sjdp DW_TAG_friend = 0x2a, 17033965Sjdp DW_TAG_namelist = 0x2b, 17133965Sjdp DW_TAG_namelist_item = 0x2c, 17233965Sjdp DW_TAG_packed_type = 0x2d, 17333965Sjdp DW_TAG_subprogram = 0x2e, 17433965Sjdp DW_TAG_template_type_param = 0x2f, 17533965Sjdp DW_TAG_template_value_param = 0x30, 17633965Sjdp DW_TAG_thrown_type = 0x31, 17733965Sjdp DW_TAG_try_block = 0x32, 17833965Sjdp DW_TAG_variant_part = 0x33, 17933965Sjdp DW_TAG_variable = 0x34, 18033965Sjdp DW_TAG_volatile_type = 0x35, 18191041Sobrien /* DWARF 3. */ 18289857Sobrien DW_TAG_dwarf_procedure = 0x36, 18389857Sobrien DW_TAG_restrict_type = 0x37, 18489857Sobrien DW_TAG_interface_type = 0x38, 18589857Sobrien DW_TAG_namespace = 0x39, 18689857Sobrien DW_TAG_imported_module = 0x3a, 18789857Sobrien DW_TAG_unspecified_type = 0x3b, 18889857Sobrien DW_TAG_partial_unit = 0x3c, 18989857Sobrien DW_TAG_imported_unit = 0x3d, 190218822Sdim DW_TAG_condition = 0x3f, 191218822Sdim DW_TAG_shared_type = 0x40, 192256852Semaste DW_TAG_rvalue_reference_type = 0x42, 19380016Sobrien /* SGI/MIPS Extensions. */ 19433965Sjdp DW_TAG_MIPS_loop = 0x4081, 195130561Sobrien /* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */ 196130561Sobrien DW_TAG_HP_array_descriptor = 0x4090, 19780016Sobrien /* GNU extensions. */ 19880016Sobrien DW_TAG_format_label = 0x4101, /* For FORTRAN 77 and Fortran 90. */ 19991041Sobrien DW_TAG_function_template = 0x4102, /* For C++. */ 20091041Sobrien DW_TAG_class_template = 0x4103, /* For C++. */ 20180016Sobrien DW_TAG_GNU_BINCL = 0x4104, 202130561Sobrien DW_TAG_GNU_EINCL = 0x4105, 203130561Sobrien /* Extensions for UPC. See: http://upc.gwu.edu/~upc. */ 204130561Sobrien DW_TAG_upc_shared_type = 0x8765, 205130561Sobrien DW_TAG_upc_strict_type = 0x8766, 206130561Sobrien DW_TAG_upc_relaxed_type = 0x8767, 207130561Sobrien /* PGI (STMicroelectronics) extensions. No documentation available. */ 208130561Sobrien DW_TAG_PGI_kanji_type = 0xA000, 209130561Sobrien DW_TAG_PGI_interface_block = 0xA020 21033965Sjdp }; 21133965Sjdp 21233965Sjdp#define DW_TAG_lo_user 0x4080 21333965Sjdp#define DW_TAG_hi_user 0xffff 21433965Sjdp 21580016Sobrien/* Flag that tells whether entry has a child or not. */ 21633965Sjdp#define DW_children_no 0 21733965Sjdp#define DW_children_yes 1 21833965Sjdp 21933965Sjdp/* Form names and codes. */ 22033965Sjdpenum dwarf_form 22133965Sjdp { 22233965Sjdp DW_FORM_addr = 0x01, 22333965Sjdp DW_FORM_block2 = 0x03, 22433965Sjdp DW_FORM_block4 = 0x04, 22533965Sjdp DW_FORM_data2 = 0x05, 22633965Sjdp DW_FORM_data4 = 0x06, 22733965Sjdp DW_FORM_data8 = 0x07, 22833965Sjdp DW_FORM_string = 0x08, 22933965Sjdp DW_FORM_block = 0x09, 23033965Sjdp DW_FORM_block1 = 0x0a, 23133965Sjdp DW_FORM_data1 = 0x0b, 23233965Sjdp DW_FORM_flag = 0x0c, 23333965Sjdp DW_FORM_sdata = 0x0d, 23433965Sjdp DW_FORM_strp = 0x0e, 23533965Sjdp DW_FORM_udata = 0x0f, 23633965Sjdp DW_FORM_ref_addr = 0x10, 23733965Sjdp DW_FORM_ref1 = 0x11, 23833965Sjdp DW_FORM_ref2 = 0x12, 23933965Sjdp DW_FORM_ref4 = 0x13, 24033965Sjdp DW_FORM_ref8 = 0x14, 24133965Sjdp DW_FORM_ref_udata = 0x15, 242240411Sdim DW_FORM_indirect = 0x16, 243240411Sdim DW_FORM_flag_present = 0x19 24433965Sjdp }; 24533965Sjdp 24633965Sjdp/* Attribute names and codes. */ 24733965Sjdpenum dwarf_attribute 24833965Sjdp { 24933965Sjdp DW_AT_sibling = 0x01, 25033965Sjdp DW_AT_location = 0x02, 25133965Sjdp DW_AT_name = 0x03, 25233965Sjdp DW_AT_ordering = 0x09, 25333965Sjdp DW_AT_subscr_data = 0x0a, 25433965Sjdp DW_AT_byte_size = 0x0b, 25533965Sjdp DW_AT_bit_offset = 0x0c, 25633965Sjdp DW_AT_bit_size = 0x0d, 25733965Sjdp DW_AT_element_list = 0x0f, 25833965Sjdp DW_AT_stmt_list = 0x10, 25933965Sjdp DW_AT_low_pc = 0x11, 26033965Sjdp DW_AT_high_pc = 0x12, 26133965Sjdp DW_AT_language = 0x13, 26233965Sjdp DW_AT_member = 0x14, 26333965Sjdp DW_AT_discr = 0x15, 26433965Sjdp DW_AT_discr_value = 0x16, 26533965Sjdp DW_AT_visibility = 0x17, 26633965Sjdp DW_AT_import = 0x18, 26733965Sjdp DW_AT_string_length = 0x19, 26833965Sjdp DW_AT_common_reference = 0x1a, 26933965Sjdp DW_AT_comp_dir = 0x1b, 27033965Sjdp DW_AT_const_value = 0x1c, 27133965Sjdp DW_AT_containing_type = 0x1d, 27233965Sjdp DW_AT_default_value = 0x1e, 27333965Sjdp DW_AT_inline = 0x20, 27433965Sjdp DW_AT_is_optional = 0x21, 27533965Sjdp DW_AT_lower_bound = 0x22, 27633965Sjdp DW_AT_producer = 0x25, 27733965Sjdp DW_AT_prototyped = 0x27, 27833965Sjdp DW_AT_return_addr = 0x2a, 27933965Sjdp DW_AT_start_scope = 0x2c, 28033965Sjdp DW_AT_stride_size = 0x2e, 28133965Sjdp DW_AT_upper_bound = 0x2f, 28233965Sjdp DW_AT_abstract_origin = 0x31, 28333965Sjdp DW_AT_accessibility = 0x32, 28433965Sjdp DW_AT_address_class = 0x33, 28533965Sjdp DW_AT_artificial = 0x34, 28633965Sjdp DW_AT_base_types = 0x35, 28733965Sjdp DW_AT_calling_convention = 0x36, 28833965Sjdp DW_AT_count = 0x37, 28933965Sjdp DW_AT_data_member_location = 0x38, 29033965Sjdp DW_AT_decl_column = 0x39, 29133965Sjdp DW_AT_decl_file = 0x3a, 29233965Sjdp DW_AT_decl_line = 0x3b, 29333965Sjdp DW_AT_declaration = 0x3c, 29433965Sjdp DW_AT_discr_list = 0x3d, 29533965Sjdp DW_AT_encoding = 0x3e, 29633965Sjdp DW_AT_external = 0x3f, 29733965Sjdp DW_AT_frame_base = 0x40, 29833965Sjdp DW_AT_friend = 0x41, 29933965Sjdp DW_AT_identifier_case = 0x42, 30033965Sjdp DW_AT_macro_info = 0x43, 30133965Sjdp DW_AT_namelist_items = 0x44, 30233965Sjdp DW_AT_priority = 0x45, 30333965Sjdp DW_AT_segment = 0x46, 30433965Sjdp DW_AT_specification = 0x47, 30533965Sjdp DW_AT_static_link = 0x48, 30633965Sjdp DW_AT_type = 0x49, 30733965Sjdp DW_AT_use_location = 0x4a, 30833965Sjdp DW_AT_variable_parameter = 0x4b, 30933965Sjdp DW_AT_virtuality = 0x4c, 31033965Sjdp DW_AT_vtable_elem_location = 0x4d, 31191041Sobrien /* DWARF 3 values. */ 31280016Sobrien DW_AT_allocated = 0x4e, 31380016Sobrien DW_AT_associated = 0x4f, 31480016Sobrien DW_AT_data_location = 0x50, 31580016Sobrien DW_AT_stride = 0x51, 31680016Sobrien DW_AT_entry_pc = 0x52, 31780016Sobrien DW_AT_use_UTF8 = 0x53, 31880016Sobrien DW_AT_extension = 0x54, 31980016Sobrien DW_AT_ranges = 0x55, 32080016Sobrien DW_AT_trampoline = 0x56, 32180016Sobrien DW_AT_call_column = 0x57, 32280016Sobrien DW_AT_call_file = 0x58, 32380016Sobrien DW_AT_call_line = 0x59, 324218822Sdim DW_AT_description = 0x5a, 325218822Sdim DW_AT_binary_scale = 0x5b, 326218822Sdim DW_AT_decimal_scale = 0x5c, 327218822Sdim DW_AT_small = 0x5d, 328218822Sdim DW_AT_decimal_sign = 0x5e, 329218822Sdim DW_AT_digit_count = 0x5f, 330218822Sdim DW_AT_picture_string = 0x60, 331218822Sdim DW_AT_mutable = 0x61, 332218822Sdim DW_AT_threads_scaled = 0x62, 333218822Sdim DW_AT_explicit = 0x63, 334218822Sdim DW_AT_object_pointer = 0x64, 335218822Sdim DW_AT_endianity = 0x65, 336218822Sdim DW_AT_elemental = 0x66, 337218822Sdim DW_AT_pure = 0x67, 338218822Sdim DW_AT_recursive = 0x68, 339130561Sobrien /* SGI/MIPS extensions. */ 34033965Sjdp DW_AT_MIPS_fde = 0x2001, 34133965Sjdp DW_AT_MIPS_loop_begin = 0x2002, 34233965Sjdp DW_AT_MIPS_tail_loop_begin = 0x2003, 34333965Sjdp DW_AT_MIPS_epilog_begin = 0x2004, 34433965Sjdp DW_AT_MIPS_loop_unroll_factor = 0x2005, 34533965Sjdp DW_AT_MIPS_software_pipeline_depth = 0x2006, 34633965Sjdp DW_AT_MIPS_linkage_name = 0x2007, 34733965Sjdp DW_AT_MIPS_stride = 0x2008, 34833965Sjdp DW_AT_MIPS_abstract_name = 0x2009, 34933965Sjdp DW_AT_MIPS_clone_origin = 0x200a, 35033965Sjdp DW_AT_MIPS_has_inlines = 0x200b, 351130561Sobrien /* HP extensions. */ 352130561Sobrien DW_AT_HP_block_index = 0x2000, 353130561Sobrien DW_AT_HP_unmodifiable = 0x2001, /* Same as DW_AT_MIPS_fde. */ 354130561Sobrien DW_AT_HP_actuals_stmt_list = 0x2010, 355130561Sobrien DW_AT_HP_proc_per_section = 0x2011, 356130561Sobrien DW_AT_HP_raw_data_ptr = 0x2012, 357130561Sobrien DW_AT_HP_pass_by_reference = 0x2013, 358130561Sobrien DW_AT_HP_opt_level = 0x2014, 359130561Sobrien DW_AT_HP_prof_version_id = 0x2015, 360130561Sobrien DW_AT_HP_opt_flags = 0x2016, 361130561Sobrien DW_AT_HP_cold_region_low_pc = 0x2017, 362130561Sobrien DW_AT_HP_cold_region_high_pc = 0x2018, 363130561Sobrien DW_AT_HP_all_variables_modifiable = 0x2019, 364130561Sobrien DW_AT_HP_linkage_name = 0x201a, 365130561Sobrien DW_AT_HP_prof_flags = 0x201b, /* In comp unit of procs_info for -g. */ 36633965Sjdp /* GNU extensions. */ 36780016Sobrien DW_AT_sf_names = 0x2101, 36880016Sobrien DW_AT_src_info = 0x2102, 36980016Sobrien DW_AT_mac_info = 0x2103, 37033965Sjdp DW_AT_src_coords = 0x2104, 37133965Sjdp DW_AT_body_begin = 0x2105, 37291041Sobrien DW_AT_body_end = 0x2106, 37399461Sobrien DW_AT_GNU_vector = 0x2107, 374130561Sobrien /* VMS extensions. */ 375130561Sobrien DW_AT_VMS_rtnbeg_pd_address = 0x2201, 376130561Sobrien /* UPC extension. */ 377130561Sobrien DW_AT_upc_threads_scaled = 0x3210, 378130561Sobrien /* PGI (STMicroelectronics) extensions. */ 379130561Sobrien DW_AT_PGI_lbase = 0x3a00, 380130561Sobrien DW_AT_PGI_soffset = 0x3a01, 381130561Sobrien DW_AT_PGI_lstride = 0x3a02 38233965Sjdp }; 38333965Sjdp 38480016Sobrien#define DW_AT_lo_user 0x2000 /* Implementation-defined range start. */ 38580016Sobrien#define DW_AT_hi_user 0x3ff0 /* Implementation-defined range end. */ 38633965Sjdp 38733965Sjdp/* Location atom names and codes. */ 38833965Sjdpenum dwarf_location_atom 38933965Sjdp { 39033965Sjdp DW_OP_addr = 0x03, 39133965Sjdp DW_OP_deref = 0x06, 39233965Sjdp DW_OP_const1u = 0x08, 39333965Sjdp DW_OP_const1s = 0x09, 39433965Sjdp DW_OP_const2u = 0x0a, 39533965Sjdp DW_OP_const2s = 0x0b, 39633965Sjdp DW_OP_const4u = 0x0c, 39733965Sjdp DW_OP_const4s = 0x0d, 39833965Sjdp DW_OP_const8u = 0x0e, 39933965Sjdp DW_OP_const8s = 0x0f, 40033965Sjdp DW_OP_constu = 0x10, 40133965Sjdp DW_OP_consts = 0x11, 40233965Sjdp DW_OP_dup = 0x12, 40333965Sjdp DW_OP_drop = 0x13, 40433965Sjdp DW_OP_over = 0x14, 40533965Sjdp DW_OP_pick = 0x15, 40633965Sjdp DW_OP_swap = 0x16, 40733965Sjdp DW_OP_rot = 0x17, 40833965Sjdp DW_OP_xderef = 0x18, 40933965Sjdp DW_OP_abs = 0x19, 41033965Sjdp DW_OP_and = 0x1a, 41133965Sjdp DW_OP_div = 0x1b, 41233965Sjdp DW_OP_minus = 0x1c, 41333965Sjdp DW_OP_mod = 0x1d, 41433965Sjdp DW_OP_mul = 0x1e, 41533965Sjdp DW_OP_neg = 0x1f, 41633965Sjdp DW_OP_not = 0x20, 41733965Sjdp DW_OP_or = 0x21, 41833965Sjdp DW_OP_plus = 0x22, 41933965Sjdp DW_OP_plus_uconst = 0x23, 42033965Sjdp DW_OP_shl = 0x24, 42133965Sjdp DW_OP_shr = 0x25, 42233965Sjdp DW_OP_shra = 0x26, 42333965Sjdp DW_OP_xor = 0x27, 42433965Sjdp DW_OP_bra = 0x28, 42533965Sjdp DW_OP_eq = 0x29, 42633965Sjdp DW_OP_ge = 0x2a, 42733965Sjdp DW_OP_gt = 0x2b, 42833965Sjdp DW_OP_le = 0x2c, 42933965Sjdp DW_OP_lt = 0x2d, 43033965Sjdp DW_OP_ne = 0x2e, 43133965Sjdp DW_OP_skip = 0x2f, 43233965Sjdp DW_OP_lit0 = 0x30, 43333965Sjdp DW_OP_lit1 = 0x31, 43433965Sjdp DW_OP_lit2 = 0x32, 43533965Sjdp DW_OP_lit3 = 0x33, 43633965Sjdp DW_OP_lit4 = 0x34, 43733965Sjdp DW_OP_lit5 = 0x35, 43833965Sjdp DW_OP_lit6 = 0x36, 43933965Sjdp DW_OP_lit7 = 0x37, 44033965Sjdp DW_OP_lit8 = 0x38, 44133965Sjdp DW_OP_lit9 = 0x39, 44233965Sjdp DW_OP_lit10 = 0x3a, 44333965Sjdp DW_OP_lit11 = 0x3b, 44433965Sjdp DW_OP_lit12 = 0x3c, 44533965Sjdp DW_OP_lit13 = 0x3d, 44633965Sjdp DW_OP_lit14 = 0x3e, 44733965Sjdp DW_OP_lit15 = 0x3f, 44833965Sjdp DW_OP_lit16 = 0x40, 44933965Sjdp DW_OP_lit17 = 0x41, 45033965Sjdp DW_OP_lit18 = 0x42, 45133965Sjdp DW_OP_lit19 = 0x43, 45233965Sjdp DW_OP_lit20 = 0x44, 45333965Sjdp DW_OP_lit21 = 0x45, 45433965Sjdp DW_OP_lit22 = 0x46, 45533965Sjdp DW_OP_lit23 = 0x47, 45633965Sjdp DW_OP_lit24 = 0x48, 45733965Sjdp DW_OP_lit25 = 0x49, 45833965Sjdp DW_OP_lit26 = 0x4a, 45933965Sjdp DW_OP_lit27 = 0x4b, 46033965Sjdp DW_OP_lit28 = 0x4c, 46133965Sjdp DW_OP_lit29 = 0x4d, 46233965Sjdp DW_OP_lit30 = 0x4e, 46333965Sjdp DW_OP_lit31 = 0x4f, 46433965Sjdp DW_OP_reg0 = 0x50, 46533965Sjdp DW_OP_reg1 = 0x51, 46633965Sjdp DW_OP_reg2 = 0x52, 46733965Sjdp DW_OP_reg3 = 0x53, 46833965Sjdp DW_OP_reg4 = 0x54, 46933965Sjdp DW_OP_reg5 = 0x55, 47033965Sjdp DW_OP_reg6 = 0x56, 47133965Sjdp DW_OP_reg7 = 0x57, 47233965Sjdp DW_OP_reg8 = 0x58, 47333965Sjdp DW_OP_reg9 = 0x59, 47433965Sjdp DW_OP_reg10 = 0x5a, 47533965Sjdp DW_OP_reg11 = 0x5b, 47633965Sjdp DW_OP_reg12 = 0x5c, 47733965Sjdp DW_OP_reg13 = 0x5d, 47833965Sjdp DW_OP_reg14 = 0x5e, 47933965Sjdp DW_OP_reg15 = 0x5f, 48033965Sjdp DW_OP_reg16 = 0x60, 48133965Sjdp DW_OP_reg17 = 0x61, 48233965Sjdp DW_OP_reg18 = 0x62, 48333965Sjdp DW_OP_reg19 = 0x63, 48433965Sjdp DW_OP_reg20 = 0x64, 48533965Sjdp DW_OP_reg21 = 0x65, 48633965Sjdp DW_OP_reg22 = 0x66, 48733965Sjdp DW_OP_reg23 = 0x67, 48833965Sjdp DW_OP_reg24 = 0x68, 48933965Sjdp DW_OP_reg25 = 0x69, 49033965Sjdp DW_OP_reg26 = 0x6a, 49133965Sjdp DW_OP_reg27 = 0x6b, 49233965Sjdp DW_OP_reg28 = 0x6c, 49333965Sjdp DW_OP_reg29 = 0x6d, 49433965Sjdp DW_OP_reg30 = 0x6e, 49533965Sjdp DW_OP_reg31 = 0x6f, 49633965Sjdp DW_OP_breg0 = 0x70, 49733965Sjdp DW_OP_breg1 = 0x71, 49833965Sjdp DW_OP_breg2 = 0x72, 49933965Sjdp DW_OP_breg3 = 0x73, 50033965Sjdp DW_OP_breg4 = 0x74, 50133965Sjdp DW_OP_breg5 = 0x75, 50233965Sjdp DW_OP_breg6 = 0x76, 50333965Sjdp DW_OP_breg7 = 0x77, 50433965Sjdp DW_OP_breg8 = 0x78, 50533965Sjdp DW_OP_breg9 = 0x79, 50633965Sjdp DW_OP_breg10 = 0x7a, 50733965Sjdp DW_OP_breg11 = 0x7b, 50833965Sjdp DW_OP_breg12 = 0x7c, 50933965Sjdp DW_OP_breg13 = 0x7d, 51033965Sjdp DW_OP_breg14 = 0x7e, 51133965Sjdp DW_OP_breg15 = 0x7f, 51233965Sjdp DW_OP_breg16 = 0x80, 51333965Sjdp DW_OP_breg17 = 0x81, 51433965Sjdp DW_OP_breg18 = 0x82, 51533965Sjdp DW_OP_breg19 = 0x83, 51633965Sjdp DW_OP_breg20 = 0x84, 51733965Sjdp DW_OP_breg21 = 0x85, 51833965Sjdp DW_OP_breg22 = 0x86, 51933965Sjdp DW_OP_breg23 = 0x87, 52033965Sjdp DW_OP_breg24 = 0x88, 52133965Sjdp DW_OP_breg25 = 0x89, 52233965Sjdp DW_OP_breg26 = 0x8a, 52333965Sjdp DW_OP_breg27 = 0x8b, 52433965Sjdp DW_OP_breg28 = 0x8c, 52533965Sjdp DW_OP_breg29 = 0x8d, 52633965Sjdp DW_OP_breg30 = 0x8e, 52733965Sjdp DW_OP_breg31 = 0x8f, 52833965Sjdp DW_OP_regx = 0x90, 52933965Sjdp DW_OP_fbreg = 0x91, 53033965Sjdp DW_OP_bregx = 0x92, 53133965Sjdp DW_OP_piece = 0x93, 53233965Sjdp DW_OP_deref_size = 0x94, 53333965Sjdp DW_OP_xderef_size = 0x95, 53480016Sobrien DW_OP_nop = 0x96, 53591041Sobrien /* DWARF 3 extensions. */ 53680016Sobrien DW_OP_push_object_address = 0x97, 53791041Sobrien DW_OP_call2 = 0x98, 53891041Sobrien DW_OP_call4 = 0x99, 539130561Sobrien DW_OP_call_ref = 0x9a, 540218822Sdim DW_OP_form_tls_address = 0x9b, 541218822Sdim DW_OP_call_frame_cfa = 0x9c, 542218822Sdim DW_OP_bit_piece = 0x9d, 543130561Sobrien /* GNU extensions. */ 544130561Sobrien DW_OP_GNU_push_tls_address = 0xe0, 545218822Sdim DW_OP_GNU_uninit = 0xf0, 546130561Sobrien /* HP extensions. */ 547130561Sobrien DW_OP_HP_unknown = 0xe0, /* Ouch, the same as GNU_push_tls_address. */ 548130561Sobrien DW_OP_HP_is_value = 0xe1, 549130561Sobrien DW_OP_HP_fltconst4 = 0xe2, 550130561Sobrien DW_OP_HP_fltconst8 = 0xe3, 551130561Sobrien DW_OP_HP_mod_range = 0xe4, 552130561Sobrien DW_OP_HP_unmod_range = 0xe5, 553130561Sobrien DW_OP_HP_tls = 0xe6 55433965Sjdp }; 55533965Sjdp 556130561Sobrien#define DW_OP_lo_user 0xe0 /* Implementation-defined range start. */ 55780016Sobrien#define DW_OP_hi_user 0xff /* Implementation-defined range end. */ 55833965Sjdp 55933965Sjdp/* Type encodings. */ 56033965Sjdpenum dwarf_type 56133965Sjdp { 56233965Sjdp DW_ATE_void = 0x0, 56333965Sjdp DW_ATE_address = 0x1, 56433965Sjdp DW_ATE_boolean = 0x2, 56533965Sjdp DW_ATE_complex_float = 0x3, 56633965Sjdp DW_ATE_float = 0x4, 56733965Sjdp DW_ATE_signed = 0x5, 56833965Sjdp DW_ATE_signed_char = 0x6, 56933965Sjdp DW_ATE_unsigned = 0x7, 57089857Sobrien DW_ATE_unsigned_char = 0x8, 57191041Sobrien /* DWARF 3. */ 572130561Sobrien DW_ATE_imaginary_float = 0x9, 573218822Sdim DW_ATE_packed_decimal = 0xa, 574218822Sdim DW_ATE_numeric_string = 0xb, 575218822Sdim DW_ATE_edited = 0xc, 576218822Sdim DW_ATE_signed_fixed = 0xd, 577218822Sdim DW_ATE_unsigned_fixed = 0xe, 578218822Sdim DW_ATE_decimal_float = 0xf, 579130561Sobrien /* HP extensions. */ 580130561Sobrien DW_ATE_HP_float80 = 0x80, /* Floating-point (80 bit). */ 581130561Sobrien DW_ATE_HP_complex_float80 = 0x81, /* Complex floating-point (80 bit). */ 582130561Sobrien DW_ATE_HP_float128 = 0x82, /* Floating-point (128 bit). */ 583130561Sobrien DW_ATE_HP_complex_float128 = 0x83, /* Complex floating-point (128 bit). */ 584130561Sobrien DW_ATE_HP_floathpintel = 0x84, /* Floating-point (82 bit IA64). */ 585130561Sobrien DW_ATE_HP_imaginary_float80 = 0x85, 586130561Sobrien DW_ATE_HP_imaginary_float128 = 0x86 58733965Sjdp }; 58833965Sjdp 58933965Sjdp#define DW_ATE_lo_user 0x80 59033965Sjdp#define DW_ATE_hi_user 0xff 59133965Sjdp 592218822Sdim/* Decimal sign encodings. */ 593218822Sdimenum dwarf_decimal_sign_encoding 594218822Sdim { 595218822Sdim /* DWARF 3. */ 596218822Sdim DW_DS_unsigned = 0x01, 597218822Sdim DW_DS_leading_overpunch = 0x02, 598218822Sdim DW_DS_trailing_overpunch = 0x03, 599218822Sdim DW_DS_leading_separate = 0x04, 600218822Sdim DW_DS_trailing_separate = 0x05 601218822Sdim }; 602218822Sdim 603218822Sdim/* Endianity encodings. */ 604218822Sdimenum dwarf_endianity_encoding 605218822Sdim { 606218822Sdim /* DWARF 3. */ 607218822Sdim DW_END_default = 0x00, 608218822Sdim DW_END_big = 0x01, 609218822Sdim DW_END_little = 0x02 610218822Sdim }; 611218822Sdim 612218822Sdim#define DW_END_lo_user 0x40 613218822Sdim#define DW_END_hi_user 0xff 614218822Sdim 61533965Sjdp/* Array ordering names and codes. */ 61633965Sjdpenum dwarf_array_dim_ordering 61733965Sjdp { 61833965Sjdp DW_ORD_row_major = 0, 61933965Sjdp DW_ORD_col_major = 1 62033965Sjdp }; 62133965Sjdp 62280016Sobrien/* Access attribute. */ 62333965Sjdpenum dwarf_access_attribute 62433965Sjdp { 62533965Sjdp DW_ACCESS_public = 1, 62633965Sjdp DW_ACCESS_protected = 2, 62733965Sjdp DW_ACCESS_private = 3 62833965Sjdp }; 62933965Sjdp 63080016Sobrien/* Visibility. */ 63133965Sjdpenum dwarf_visibility_attribute 63233965Sjdp { 63333965Sjdp DW_VIS_local = 1, 63433965Sjdp DW_VIS_exported = 2, 63533965Sjdp DW_VIS_qualified = 3 63633965Sjdp }; 63733965Sjdp 63880016Sobrien/* Virtuality. */ 63933965Sjdpenum dwarf_virtuality_attribute 64033965Sjdp { 64133965Sjdp DW_VIRTUALITY_none = 0, 64233965Sjdp DW_VIRTUALITY_virtual = 1, 64333965Sjdp DW_VIRTUALITY_pure_virtual = 2 64433965Sjdp }; 64533965Sjdp 64680016Sobrien/* Case sensitivity. */ 64733965Sjdpenum dwarf_id_case 64833965Sjdp { 64933965Sjdp DW_ID_case_sensitive = 0, 65033965Sjdp DW_ID_up_case = 1, 65133965Sjdp DW_ID_down_case = 2, 65233965Sjdp DW_ID_case_insensitive = 3 65333965Sjdp }; 65433965Sjdp 65580016Sobrien/* Calling convention. */ 65633965Sjdpenum dwarf_calling_convention 65733965Sjdp { 65833965Sjdp DW_CC_normal = 0x1, 65933965Sjdp DW_CC_program = 0x2, 660218822Sdim DW_CC_nocall = 0x3, 661218822Sdim DW_CC_GNU_renesas_sh = 0x40 66233965Sjdp }; 66333965Sjdp 66433965Sjdp#define DW_CC_lo_user 0x40 66533965Sjdp#define DW_CC_hi_user 0xff 66633965Sjdp 66780016Sobrien/* Inline attribute. */ 66833965Sjdpenum dwarf_inline_attribute 66933965Sjdp { 67033965Sjdp DW_INL_not_inlined = 0, 67133965Sjdp DW_INL_inlined = 1, 67233965Sjdp DW_INL_declared_not_inlined = 2, 67333965Sjdp DW_INL_declared_inlined = 3 67433965Sjdp }; 67533965Sjdp 67689857Sobrien/* Discriminant lists. */ 67789857Sobrienenum dwarf_discrim_list 67833965Sjdp { 67933965Sjdp DW_DSC_label = 0, 68033965Sjdp DW_DSC_range = 1 68133965Sjdp }; 68233965Sjdp 68380016Sobrien/* Line number opcodes. */ 68433965Sjdpenum dwarf_line_number_ops 68533965Sjdp { 68633965Sjdp DW_LNS_extended_op = 0, 68733965Sjdp DW_LNS_copy = 1, 68833965Sjdp DW_LNS_advance_pc = 2, 68933965Sjdp DW_LNS_advance_line = 3, 69033965Sjdp DW_LNS_set_file = 4, 69133965Sjdp DW_LNS_set_column = 5, 69233965Sjdp DW_LNS_negate_stmt = 6, 69333965Sjdp DW_LNS_set_basic_block = 7, 69433965Sjdp DW_LNS_const_add_pc = 8, 69589857Sobrien DW_LNS_fixed_advance_pc = 9, 69691041Sobrien /* DWARF 3. */ 69789857Sobrien DW_LNS_set_prologue_end = 10, 69889857Sobrien DW_LNS_set_epilogue_begin = 11, 69989857Sobrien DW_LNS_set_isa = 12 70033965Sjdp }; 70133965Sjdp 70280016Sobrien/* Line number extended opcodes. */ 70333965Sjdpenum dwarf_line_number_x_ops 70433965Sjdp { 70533965Sjdp DW_LNE_end_sequence = 1, 70633965Sjdp DW_LNE_set_address = 2, 707130561Sobrien DW_LNE_define_file = 3, 708130561Sobrien /* HP extensions. */ 709130561Sobrien DW_LNE_HP_negate_is_UV_update = 0x11, 710130561Sobrien DW_LNE_HP_push_context = 0x12, 711130561Sobrien DW_LNE_HP_pop_context = 0x13, 712130561Sobrien DW_LNE_HP_set_file_line_column = 0x14, 713130561Sobrien DW_LNE_HP_set_routine_name = 0x15, 714130561Sobrien DW_LNE_HP_set_sequence = 0x16, 715130561Sobrien DW_LNE_HP_negate_post_semantics = 0x17, 716130561Sobrien DW_LNE_HP_negate_function_exit = 0x18, 717130561Sobrien DW_LNE_HP_negate_front_end_logical = 0x19, 718130561Sobrien DW_LNE_HP_define_proc = 0x20 71933965Sjdp }; 72033965Sjdp 721218822Sdim#define DW_LNE_lo_user 0x80 722218822Sdim#define DW_LNE_hi_user 0xff 723218822Sdim 72480016Sobrien/* Call frame information. */ 72533965Sjdpenum dwarf_call_frame_info 72633965Sjdp { 72733965Sjdp DW_CFA_advance_loc = 0x40, 72833965Sjdp DW_CFA_offset = 0x80, 72933965Sjdp DW_CFA_restore = 0xc0, 73033965Sjdp DW_CFA_nop = 0x00, 73133965Sjdp DW_CFA_set_loc = 0x01, 73233965Sjdp DW_CFA_advance_loc1 = 0x02, 73333965Sjdp DW_CFA_advance_loc2 = 0x03, 73433965Sjdp DW_CFA_advance_loc4 = 0x04, 73533965Sjdp DW_CFA_offset_extended = 0x05, 73633965Sjdp DW_CFA_restore_extended = 0x06, 73733965Sjdp DW_CFA_undefined = 0x07, 73833965Sjdp DW_CFA_same_value = 0x08, 73933965Sjdp DW_CFA_register = 0x09, 74033965Sjdp DW_CFA_remember_state = 0x0a, 74133965Sjdp DW_CFA_restore_state = 0x0b, 74233965Sjdp DW_CFA_def_cfa = 0x0c, 74333965Sjdp DW_CFA_def_cfa_register = 0x0d, 74433965Sjdp DW_CFA_def_cfa_offset = 0x0e, 74591041Sobrien /* DWARF 3. */ 74680016Sobrien DW_CFA_def_cfa_expression = 0x0f, 74780016Sobrien DW_CFA_expression = 0x10, 74880016Sobrien DW_CFA_offset_extended_sf = 0x11, 74980016Sobrien DW_CFA_def_cfa_sf = 0x12, 75080016Sobrien DW_CFA_def_cfa_offset_sf = 0x13, 751218822Sdim DW_CFA_val_offset = 0x14, 752218822Sdim DW_CFA_val_offset_sf = 0x15, 753218822Sdim DW_CFA_val_expression = 0x16, 75480016Sobrien /* SGI/MIPS specific. */ 75580016Sobrien DW_CFA_MIPS_advance_loc8 = 0x1d, 75680016Sobrien /* GNU extensions. */ 75780016Sobrien DW_CFA_GNU_window_save = 0x2d, 75880016Sobrien DW_CFA_GNU_args_size = 0x2e, 75980016Sobrien DW_CFA_GNU_negative_offset_extended = 0x2f 76033965Sjdp }; 76133965Sjdp 76233965Sjdp#define DW_CIE_ID 0xffffffff 76333965Sjdp#define DW_CIE_VERSION 1 76433965Sjdp 76533965Sjdp#define DW_CFA_extended 0 766104834Sobrien#define DW_CFA_lo_user 0x1c 767104834Sobrien#define DW_CFA_hi_user 0x3f 76833965Sjdp 76933965Sjdp#define DW_CHILDREN_no 0x00 77033965Sjdp#define DW_CHILDREN_yes 0x01 77133965Sjdp 77233965Sjdp#define DW_ADDR_none 0 77333965Sjdp 77433965Sjdp/* Source language names and codes. */ 77533965Sjdpenum dwarf_source_language 77633965Sjdp { 77733965Sjdp DW_LANG_C89 = 0x0001, 77833965Sjdp DW_LANG_C = 0x0002, 77933965Sjdp DW_LANG_Ada83 = 0x0003, 78033965Sjdp DW_LANG_C_plus_plus = 0x0004, 78133965Sjdp DW_LANG_Cobol74 = 0x0005, 78233965Sjdp DW_LANG_Cobol85 = 0x0006, 78333965Sjdp DW_LANG_Fortran77 = 0x0007, 78433965Sjdp DW_LANG_Fortran90 = 0x0008, 78533965Sjdp DW_LANG_Pascal83 = 0x0009, 78633965Sjdp DW_LANG_Modula2 = 0x000a, 787218822Sdim /* DWARF 3. */ 78889857Sobrien DW_LANG_Java = 0x000b, 78989857Sobrien DW_LANG_C99 = 0x000c, 79089857Sobrien DW_LANG_Ada95 = 0x000d, 79189857Sobrien DW_LANG_Fortran95 = 0x000e, 792218822Sdim DW_LANG_PLI = 0x000f, 793218822Sdim DW_LANG_ObjC = 0x0010, 794218822Sdim DW_LANG_ObjC_plus_plus = 0x0011, 795218822Sdim DW_LANG_UPC = 0x0012, 796218822Sdim DW_LANG_D = 0x0013, 79789857Sobrien /* MIPS. */ 798130561Sobrien DW_LANG_Mips_Assembler = 0x8001, 799130561Sobrien /* UPC. */ 800130561Sobrien DW_LANG_Upc = 0x8765 80133965Sjdp }; 80233965Sjdp 80380016Sobrien#define DW_LANG_lo_user 0x8000 /* Implementation-defined range start. */ 80480016Sobrien#define DW_LANG_hi_user 0xffff /* Implementation-defined range start. */ 80533965Sjdp 80633965Sjdp/* Names and codes for macro information. */ 80733965Sjdpenum dwarf_macinfo_record_type 80833965Sjdp { 80933965Sjdp DW_MACINFO_define = 1, 81033965Sjdp DW_MACINFO_undef = 2, 81133965Sjdp DW_MACINFO_start_file = 3, 81233965Sjdp DW_MACINFO_end_file = 4, 81333965Sjdp DW_MACINFO_vendor_ext = 255 81433965Sjdp }; 81589857Sobrien 81689857Sobrien/* @@@ For use with GNU frame unwind information. */ 81789857Sobrien 81889857Sobrien#define DW_EH_PE_absptr 0x00 81989857Sobrien#define DW_EH_PE_omit 0xff 82089857Sobrien 82189857Sobrien#define DW_EH_PE_uleb128 0x01 82289857Sobrien#define DW_EH_PE_udata2 0x02 82389857Sobrien#define DW_EH_PE_udata4 0x03 82489857Sobrien#define DW_EH_PE_udata8 0x04 82589857Sobrien#define DW_EH_PE_sleb128 0x09 82689857Sobrien#define DW_EH_PE_sdata2 0x0A 82789857Sobrien#define DW_EH_PE_sdata4 0x0B 82889857Sobrien#define DW_EH_PE_sdata8 0x0C 82989857Sobrien#define DW_EH_PE_signed 0x08 83089857Sobrien 83189857Sobrien#define DW_EH_PE_pcrel 0x10 83289857Sobrien#define DW_EH_PE_textrel 0x20 83389857Sobrien#define DW_EH_PE_datarel 0x30 83489857Sobrien#define DW_EH_PE_funcrel 0x40 83589857Sobrien#define DW_EH_PE_aligned 0x50 83689857Sobrien 83789857Sobrien#define DW_EH_PE_indirect 0x80 83889857Sobrien 83933965Sjdp#endif /* _ELF_DWARF2_H */ 840