⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dwarf2.h

📁 主要用于在线分析dsp目标代码的调试信息。DSP平台下用CCS调试源代码时
💻 H
📖 第 1 页 / 共 4 页
字号:
/**************************************************************
** Copyright (C) 2002-2007 基础技术开发部
** All right reserved
***************************************************************
**
** 项目名称:DWARF解析
** 功能简介:根据DWARF2规范定义解析常量与需要的结构
**
** 原始作者:段太钢  Email:duantaigang@xjgc.com
** 组织部门:许继集团 许继电气技术中心嵌入式软件开发部
** 备    注:
** 建立时间:2007-3-22 17:11
** 完成时间:2007-3-22 17:11
** 版    本:1.0
***************************************************************
** 单元标识:$Id: dwarf2.h,v 1.2 2007/11/09 08:35:42 dtg Exp $
** 版本历史:
** 修 改 者:
** 最近修改:
**************************************************************/

#ifndef _DWARF2_H_
#define _DWARF2_H_

/* 只用来显示变量结构与类型. 所以之定义了 debug_info 与 debug_abbrev 相关的定义 */

/* Strcuture found in .debug_info section.  */
typedef struct
{
    unsigned char  cu_length        [4];/* length */
    unsigned char  cu_version       [2];/* version */
    unsigned char  cu_abbrev_offset [4];/* offset */
    unsigned char  cu_pointer_size  [1]; /* version */
}DWARF2_External_CompUnit;

typedef struct
{
    unsigned int  cu_length;
    unsigned short cu_version;
    unsigned int  cu_abbrev_offset;
    unsigned char  cu_pointer_size;
}DWARF2_Internal_CompUnit;

typedef struct
{
    unsigned char  ar_length       [4];/* length */
    unsigned char  ar_version      [2];/* version */
    unsigned char  ar_info_offset  [4];/* version */
    unsigned char  ar_pointer_size [1];/* version */
    unsigned char  ar_segment_size [1];/* version */
}DWARF2_External_ARange;

typedef struct
{
    unsigned int  ar_length;
    unsigned short ar_version;
    unsigned int  ar_info_offset;
    unsigned char  ar_pointer_size;
    unsigned char  ar_segment_size;
}DWARF2_Internal_ARange;

/* Tag names and codes.  */
enum dwarf_tag
{
    DW_TAG_padding = 0x00, /* comment */
    DW_TAG_array_type = 0x01, /* comment */
    DW_TAG_class_type = 0x02, /* comment */
    DW_TAG_entry_point = 0x03, /* comment */
    DW_TAG_enumeration_type = 0x04, /* comment */
    DW_TAG_formal_parameter = 0x05, /* comment */
    DW_TAG_imported_declaration = 0x08, /* comment */
    DW_TAG_label = 0x0a, /* comment */
    DW_TAG_lexical_block = 0x0b, /* comment */
    DW_TAG_member = 0x0d, /* comment */
    DW_TAG_pointer_type = 0x0f, /* comment */
    DW_TAG_reference_type = 0x10, /* comment */
    DW_TAG_compile_unit = 0x11, /* comment */
    DW_TAG_string_type = 0x12, /* comment */
    DW_TAG_structure_type = 0x13, /* comment */
    DW_TAG_subroutine_type = 0x15, /* comment */
    DW_TAG_typedef = 0x16, /* comment */
    DW_TAG_union_type = 0x17, /* comment */
    DW_TAG_unspecified_parameters = 0x18, /* comment */
    DW_TAG_variant = 0x19, /* comment */
    DW_TAG_common_block = 0x1a, /* comment */
    DW_TAG_common_inclusion = 0x1b, /* comment */
    DW_TAG_inheritance = 0x1c, /* comment */
    DW_TAG_inlined_subroutine = 0x1d, /* comment */
    DW_TAG_module = 0x1e, /* comment */
    DW_TAG_ptr_to_member_type = 0x1f, /* comment */
    DW_TAG_set_type = 0x20, /* comment */
    DW_TAG_subrange_type = 0x21, /* comment */
    DW_TAG_with_stmt = 0x22, /* comment */
    DW_TAG_access_declaration = 0x23, /* comment */
    DW_TAG_base_type = 0x24, /* comment */
    DW_TAG_catch_block = 0x25, /* comment */
    DW_TAG_const_type = 0x26, /* comment */
    DW_TAG_constant = 0x27, /* comment */
    DW_TAG_enumerator = 0x28, /* comment */
    DW_TAG_file_type = 0x29, /* comment */
    DW_TAG_friend = 0x2a, /* comment */
    DW_TAG_namelist = 0x2b, /* comment */
    DW_TAG_namelist_item = 0x2c, /* comment */
    DW_TAG_packed_type = 0x2d, /* comment */
    DW_TAG_subprogram = 0x2e, /* comment */
    DW_TAG_template_type_param = 0x2f, /* comment */
    DW_TAG_template_value_param = 0x30, /* comment */
    DW_TAG_thrown_type = 0x31, /* comment */
    DW_TAG_try_block = 0x32, /* comment */
    DW_TAG_variant_part = 0x33, /* comment */
    DW_TAG_variable = 0x34, /* comment */
    DW_TAG_volatile_type = 0x35, /* comment */
    /* DWARF 3.  */
    DW_TAG_dwarf_procedure = 0x36, /* comment */
    DW_TAG_restrict_type = 0x37, /* comment */
    DW_TAG_interface_type = 0x38, /* comment */
    DW_TAG_namespace = 0x39, /* comment */
    DW_TAG_imported_module = 0x3a, /* comment */
    DW_TAG_unspecified_type = 0x3b, /* comment */
    DW_TAG_partial_unit = 0x3c, /* comment */
    DW_TAG_imported_unit = 0x3d, /* comment */
    /* SGI/MIPS Extensions.  */
    DW_TAG_MIPS_loop = 0x4081, /* comment */
    /* GNU extensions.  */
    DW_TAG_format_label = 0x4101,   /* For FORTRAN 77 and Fortran 90.  */
    DW_TAG_function_template = 0x4102,  /* For C++.  */
    DW_TAG_class_template = 0x4103, /* For C++.  */
    DW_TAG_GNU_BINCL = 0x4104, /* comment */
    DW_TAG_GNU_EINCL = 0x4105 /* comment */
};

#define DW_TAG_lo_user  0x4080 /* comment */
#define DW_TAG_hi_user  0xffff /* comment */

/* Flag that tells whether entry has a child or not.  */
#define DW_children_no   0 /* comment */
#define DW_children_yes  1 /* comment */

/* Form names and codes.  */
enum dwarf_form
{
    DW_FORM_addr = 0x01, /* comment */
    DW_FORM_block2 = 0x03, /* comment */
    DW_FORM_block4 = 0x04, /* comment */
    DW_FORM_data2 = 0x05, /* comment */
    DW_FORM_data4 = 0x06, /* comment */
    DW_FORM_data8 = 0x07, /* comment */
    DW_FORM_string = 0x08, /* comment */
    DW_FORM_block = 0x09, /* comment */
    DW_FORM_block1 = 0x0a, /* comment */
    DW_FORM_data1 = 0x0b, /* comment */
    DW_FORM_flag = 0x0c, /* comment */
    DW_FORM_sdata = 0x0d, /* comment */
    DW_FORM_strp = 0x0e, /* comment */
    DW_FORM_udata = 0x0f, /* comment */
    DW_FORM_ref_addr = 0x10, /* comment */
    DW_FORM_ref1 = 0x11, /* comment */
    DW_FORM_ref2 = 0x12, /* comment */
    DW_FORM_ref4 = 0x13, /* comment */
    DW_FORM_ref8 = 0x14, /* comment */
    DW_FORM_ref_udata = 0x15, /* comment */
    DW_FORM_indirect = 0x16 /* comment */
};

/* Attribute names and codes.  */

enum dwarf_attribute
{
    DW_AT_sibling = 0x01, /* comment */
    DW_AT_location = 0x02, /* comment */
    DW_AT_name = 0x03, /* comment */
    DW_AT_ordering = 0x09, /* comment */
    DW_AT_subscr_data = 0x0a, /* comment */
    DW_AT_byte_size = 0x0b, /* comment */
    DW_AT_bit_offset = 0x0c, /* comment */
    DW_AT_bit_size = 0x0d, /* comment */
    DW_AT_element_list = 0x0f, /* comment */
    DW_AT_stmt_list = 0x10, /* comment */
    DW_AT_low_pc = 0x11, /* comment */
    DW_AT_high_pc = 0x12, /* comment */
    DW_AT_language = 0x13, /* comment */
    DW_AT_member = 0x14, /* comment */
    DW_AT_discr = 0x15, /* comment */
    DW_AT_discr_value = 0x16, /* comment */
    DW_AT_visibility = 0x17, /* comment */
    DW_AT_import = 0x18, /* comment */
    DW_AT_string_length = 0x19, /* comment */
    DW_AT_common_reference = 0x1a, /* comment */
    DW_AT_comp_dir = 0x1b, /* comment */
    DW_AT_const_value = 0x1c, /* comment */
    DW_AT_containing_type = 0x1d, /* comment */
    DW_AT_default_value = 0x1e, /* comment */
    DW_AT_inline = 0x20, /* comment */
    DW_AT_is_optional = 0x21, /* comment */
    DW_AT_lower_bound = 0x22, /* comment */
    DW_AT_producer = 0x25, /* comment */
    DW_AT_prototyped = 0x27, /* comment */
    DW_AT_return_addr = 0x2a, /* comment */
    DW_AT_start_scope = 0x2c, /* comment */
    DW_AT_stride_size = 0x2e, /* comment */
    DW_AT_upper_bound = 0x2f, /* comment */
    DW_AT_abstract_origin = 0x31, /* comment */
    DW_AT_accessibility = 0x32, /* comment */
    DW_AT_address_class = 0x33, /* comment */
    DW_AT_artificial = 0x34, /* comment */
    DW_AT_base_types = 0x35, /* comment */
    DW_AT_calling_convention = 0x36, /* comment */
    DW_AT_count = 0x37, /* comment */
    DW_AT_data_member_location = 0x38, /* comment */
    DW_AT_decl_column = 0x39, /* comment */
    DW_AT_decl_file = 0x3a, /* comment */
    DW_AT_decl_line = 0x3b, /* comment */
    DW_AT_declaration = 0x3c, /* comment */
    DW_AT_discr_list = 0x3d, /* comment */
    DW_AT_encoding = 0x3e, /* comment */
    DW_AT_external = 0x3f, /* comment */
    DW_AT_frame_base = 0x40, /* comment */
    DW_AT_friend = 0x41, /* comment */
    DW_AT_identifier_case = 0x42, /* comment */
    DW_AT_macro_info = 0x43, /* comment */
    DW_AT_namelist_items = 0x44, /* comment */
    DW_AT_priority = 0x45, /* comment */
    DW_AT_segment = 0x46, /* comment */
    DW_AT_specification = 0x47, /* comment */
    DW_AT_static_link = 0x48, /* comment */
    DW_AT_type = 0x49, /* comment */
    DW_AT_use_location = 0x4a, /* comment */
    DW_AT_variable_parameter = 0x4b, /* comment */
    DW_AT_virtuality = 0x4c, /* comment */
    DW_AT_vtable_elem_location = 0x4d, /* comment */
    /* DWARF 3 values.  */
    DW_AT_allocated     = 0x4e, /* comment */
    DW_AT_associated    = 0x4f, /* comment */
    DW_AT_data_location = 0x50, /* comment */
    DW_AT_stride        = 0x51, /* comment */
    DW_AT_entry_pc      = 0x52, /* comment */
    DW_AT_use_UTF8      = 0x53, /* comment */
    DW_AT_extension     = 0x54, /* comment */
    DW_AT_ranges        = 0x55, /* comment */
    DW_AT_trampoline    = 0x56, /* comment */
    DW_AT_call_column   = 0x57, /* comment */
    DW_AT_call_file     = 0x58, /* comment */
    DW_AT_call_line     = 0x59, /* comment */
    /* SGI/MIPS Extensions.  */
    DW_AT_MIPS_fde = 0x2001, /* comment */
    DW_AT_MIPS_loop_begin = 0x2002, /* comment */
    DW_AT_MIPS_tail_loop_begin = 0x2003, /* comment */
    DW_AT_MIPS_epilog_begin = 0x2004, /* comment */
    DW_AT_MIPS_loop_unroll_factor = 0x2005, /* comment */
    DW_AT_MIPS_software_pipeline_depth = 0x2006, /* comment */
    DW_AT_MIPS_linkage_name = 0x2007, /* comment */
    DW_AT_MIPS_stride = 0x2008, /* comment */
    DW_AT_MIPS_abstract_name = 0x2009, /* comment */
    DW_AT_MIPS_clone_origin = 0x200a, /* comment */
    DW_AT_MIPS_has_inlines = 0x200b, /* comment */
    /* GNU extensions.  */
    DW_AT_sf_names   = 0x2101, /* comment */
    DW_AT_src_info   = 0x2102, /* comment */
    DW_AT_mac_info   = 0x2103, /* comment */
    DW_AT_src_coords = 0x2104, /* comment */
    DW_AT_body_begin = 0x2105, /* comment */
    DW_AT_body_end   = 0x2106, /* comment */
    DW_AT_GNU_vector = 0x2107, /* comment */
    /* VMS Extensions.  */
    DW_AT_VMS_rtnbeg_pd_address = 0x2201 /* comment */
};

#define DW_AT_lo_user   0x2000  /* Implementation-defined range start.  */
#define DW_AT_hi_user   0x3ff0  /* Implementation-defined range end.  */

/* Location atom names and codes.  */
enum dwarf_location_atom
{
    DW_OP_addr = 0x03, /* comment */
    DW_OP_deref = 0x06, /* comment */
    DW_OP_const1u = 0x08, /* comment */
    DW_OP_const1s = 0x09, /* comment */
    DW_OP_const2u = 0x0a, /* comment */
    DW_OP_const2s = 0x0b, /* comment */
    DW_OP_const4u = 0x0c, /* comment */
    DW_OP_const4s = 0x0d, /* comment */
    DW_OP_const8u = 0x0e, /* comment */
    DW_OP_const8s = 0x0f, /* comment */
    DW_OP_constu = 0x10, /* comment */
    DW_OP_consts = 0x11, /* comment */
    DW_OP_dup = 0x12, /* comment */
    DW_OP_drop = 0x13, /* comment */
    DW_OP_over = 0x14, /* comment */
    DW_OP_pick = 0x15, /* comment */
    DW_OP_swap = 0x16, /* comment */
    DW_OP_rot = 0x17, /* comment */
    DW_OP_xderef = 0x18, /* comment */
    DW_OP_abs = 0x19, /* comment */
    DW_OP_and = 0x1a, /* comment */
    DW_OP_div = 0x1b, /* comment */
    DW_OP_minus = 0x1c, /* comment */
    DW_OP_mod = 0x1d, /* comment */
    DW_OP_mul = 0x1e, /* comment */
    DW_OP_neg = 0x1f, /* comment */
    DW_OP_not = 0x20, /* comment */
    DW_OP_or = 0x21, /* comment */
    DW_OP_plus = 0x22, /* comment */
    DW_OP_plus_uconst = 0x23, /* comment */
    DW_OP_shl = 0x24, /* comment */
    DW_OP_shr = 0x25, /* comment */
    DW_OP_shra = 0x26, /* comment */
    DW_OP_xor = 0x27, /* comment */
    DW_OP_bra = 0x28, /* comment */
    DW_OP_eq = 0x29, /* comment */
    DW_OP_ge = 0x2a, /* comment */
    DW_OP_gt = 0x2b, /* comment */
    DW_OP_le = 0x2c, /* comment */
    DW_OP_lt = 0x2d, /* comment */
    DW_OP_ne = 0x2e, /* comment */
    DW_OP_skip = 0x2f, /* comment */
    DW_OP_lit0 = 0x30, /* comment */
    DW_OP_lit1 = 0x31, /* comment */
    DW_OP_lit2 = 0x32, /* comment */
    DW_OP_lit3 = 0x33, /* comment */
    DW_OP_lit4 = 0x34, /* comment */
    DW_OP_lit5 = 0x35, /* comment */
    DW_OP_lit6 = 0x36, /* comment */
    DW_OP_lit7 = 0x37, /* comment */
    DW_OP_lit8 = 0x38, /* comment */
    DW_OP_lit9 = 0x39, /* comment */
    DW_OP_lit10 = 0x3a, /* comment */
    DW_OP_lit11 = 0x3b, /* comment */
    DW_OP_lit12 = 0x3c, /* comment */
    DW_OP_lit13 = 0x3d, /* comment */
    DW_OP_lit14 = 0x3e, /* comment */
    DW_OP_lit15 = 0x3f, /* comment */
    DW_OP_lit16 = 0x40, /* comment */
    DW_OP_lit17 = 0x41, /* comment */
    DW_OP_lit18 = 0x42, /* comment */
    DW_OP_lit19 = 0x43, /* comment */
    DW_OP_lit20 = 0x44, /* comment */
    DW_OP_lit21 = 0x45, /* comment */
    DW_OP_lit22 = 0x46, /* comment */
    DW_OP_lit23 = 0x47, /* comment */
    DW_OP_lit24 = 0x48, /* comment */
    DW_OP_lit25 = 0x49, /* comment */
    DW_OP_lit26 = 0x4a, /* comment */
    DW_OP_lit27 = 0x4b, /* comment */
    DW_OP_lit28 = 0x4c, /* comment */
    DW_OP_lit29 = 0x4d, /* comment */
    DW_OP_lit30 = 0x4e, /* comment */
    DW_OP_lit31 = 0x4f, /* comment */
    DW_OP_reg0 = 0x50, /* comment */
    DW_OP_reg1 = 0x51, /* comment */
    DW_OP_reg2 = 0x52, /* comment */
    DW_OP_reg3 = 0x53, /* comment */
    DW_OP_reg4 = 0x54, /* comment */
    DW_OP_reg5 = 0x55, /* comment */
    DW_OP_reg6 = 0x56, /* comment */
    DW_OP_reg7 = 0x57, /* comment */
    DW_OP_reg8 = 0x58, /* comment */
    DW_OP_reg9 = 0x59, /* comment */
    DW_OP_reg10 = 0x5a, /* comment */
    DW_OP_reg11 = 0x5b, /* comment */
    DW_OP_reg12 = 0x5c, /* comment */
    DW_OP_reg13 = 0x5d, /* comment */
    DW_OP_reg14 = 0x5e, /* comment */
    DW_OP_reg15 = 0x5f, /* comment */
    DW_OP_reg16 = 0x60, /* comment */
    DW_OP_reg17 = 0x61, /* comment */
    DW_OP_reg18 = 0x62, /* comment */
    DW_OP_reg19 = 0x63, /* comment */
    DW_OP_reg20 = 0x64, /* comment */
    DW_OP_reg21 = 0x65, /* comment */
    DW_OP_reg22 = 0x66, /* comment */
    DW_OP_reg23 = 0x67, /* comment */
    DW_OP_reg24 = 0x68, /* comment */
    DW_OP_reg25 = 0x69, /* comment */
    DW_OP_reg26 = 0x6a, /* comment */
    DW_OP_reg27 = 0x6b, /* comment */
    DW_OP_reg28 = 0x6c, /* comment */
    DW_OP_reg29 = 0x6d, /* comment */
    DW_OP_reg30 = 0x6e, /* comment */
    DW_OP_reg31 = 0x6f, /* comment */
    DW_OP_breg0 = 0x70, /* comment */
    DW_OP_breg1 = 0x71, /* comment */
    DW_OP_breg2 = 0x72, /* comment */
    DW_OP_breg3 = 0x73, /* comment */
    DW_OP_breg4 = 0x74, /* comment */
    DW_OP_breg5 = 0x75, /* comment */
    DW_OP_breg6 = 0x76, /* comment */
    DW_OP_breg7 = 0x77, /* comment */
    DW_OP_breg8 = 0x78, /* comment */
    DW_OP_breg9 = 0x79, /* comment */
    DW_OP_breg10 = 0x7a, /* comment */
    DW_OP_breg11 = 0x7b, /* comment */
    DW_OP_breg12 = 0x7c, /* comment */
    DW_OP_breg13 = 0x7d, /* comment */
    DW_OP_breg14 = 0x7e, /* comment */
    DW_OP_breg15 = 0x7f, /* comment */
    DW_OP_breg16 = 0x80, /* comment */
    DW_OP_breg17 = 0x81, /* comment */
    DW_OP_breg18 = 0x82, /* comment */
    DW_OP_breg19 = 0x83, /* comment */
    DW_OP_breg20 = 0x84, /* comment */
    DW_OP_breg21 = 0x85, /* comment */
    DW_OP_breg22 = 0x86, /* comment */
    DW_OP_breg23 = 0x87, /* comment */
    DW_OP_breg24 = 0x88, /* comment */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -