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

📄 dwarf2.h

📁 主要用于在线分析dsp目标代码的调试信息。DSP平台下用CCS调试源代码时
💻 H
📖 第 1 页 / 共 4 页
字号:
    DW_OP_breg25 = 0x89, /* comment */
    DW_OP_breg26 = 0x8a, /* comment */
    DW_OP_breg27 = 0x8b, /* comment */
    DW_OP_breg28 = 0x8c, /* comment */
    DW_OP_breg29 = 0x8d, /* comment */
    DW_OP_breg30 = 0x8e, /* comment */
    DW_OP_breg31 = 0x8f, /* comment */
    DW_OP_regx = 0x90, /* comment */
    DW_OP_fbreg = 0x91, /* comment */
    DW_OP_bregx = 0x92, /* comment */
    DW_OP_piece = 0x93, /* comment */
    DW_OP_deref_size = 0x94, /* comment */
    DW_OP_xderef_size = 0x95, /* comment */
    DW_OP_nop = 0x96, /* comment */
    /* DWARF 3 extensions.  */
    DW_OP_push_object_address = 0x97, /* comment */
    DW_OP_call2 = 0x98, /* comment */
    DW_OP_call4 = 0x99, /* comment */
    DW_OP_calli = 0x9a /* comment */
};

#define DW_OP_lo_user   0x80    /* Implementation-defined range start.  */
#define DW_OP_hi_user   0xff    /* Implementation-defined range end.  */

/* Type encodings.  */
enum dwarf_type
{
    DW_ATE_void = 0x0, /* comment */
    DW_ATE_address = 0x1, /* comment */
    DW_ATE_boolean = 0x2, /* comment */
    DW_ATE_complex_float = 0x3, /* comment */
    DW_ATE_float = 0x4, /* comment */
    DW_ATE_signed = 0x5, /* comment */
    DW_ATE_signed_char = 0x6, /* comment */
    DW_ATE_unsigned = 0x7, /* comment */
    DW_ATE_unsigned_char = 0x8, /* comment */
    /* DWARF 3.  */
    DW_ATE_imaginary_float = 0x9 /* comment */
};

#define DW_ATE_lo_user 0x80 /* comment */
#define DW_ATE_hi_user 0xff /* comment */

/* Array ordering names and codes.  */
enum dwarf_array_dim_ordering
{
    DW_ORD_row_major = 0, /* comment */
    DW_ORD_col_major = 1 /* comment */
};

/* Access attribute.  */
enum dwarf_access_attribute
{
    DW_ACCESS_public = 1, /* comment */
    DW_ACCESS_protected = 2, /* comment */
    DW_ACCESS_private = 3 /* comment */
};

/* Visibility.  */
enum dwarf_visibility_attribute
{
    DW_VIS_local = 1, /* comment */
    DW_VIS_exported = 2, /* comment */
    DW_VIS_qualified = 3 /* comment */
};

/* Virtuality.  */
enum dwarf_virtuality_attribute
{
    DW_VIRTUALITY_none = 0, /* comment */
    DW_VIRTUALITY_virtual = 1, /* comment */
    DW_VIRTUALITY_pure_virtual = 2 /* comment */
};

/* Case sensitivity.  */
enum dwarf_id_case
{
    DW_ID_case_sensitive = 0, /* comment */
    DW_ID_up_case = 1, /* comment */
    DW_ID_down_case = 2, /* comment */
    DW_ID_case_insensitive = 3 /* comment */
};

/* Calling convention.  */
enum dwarf_calling_convention
{
    DW_CC_normal = 0x1, /* comment */
    DW_CC_program = 0x2, /* comment */
    DW_CC_nocall = 0x3 /* comment */
};

#define DW_CC_lo_user 0x40 /* comment */
#define DW_CC_hi_user 0xff /* comment */

/* Inline attribute.  */
enum dwarf_inline_attribute
{
    DW_INL_not_inlined = 0, /* comment */
    DW_INL_inlined = 1, /* comment */
    DW_INL_declared_not_inlined = 2, /* comment */
    DW_INL_declared_inlined = 3 /* comment */
};

/* Discriminant lists.  */
enum dwarf_discrim_list
{
    DW_DSC_label = 0, /* comment */
    DW_DSC_range = 1 /* comment */
};

/* Support for complaining about things in the symbol file that aren't
   catastrophic.

   Each such thing gets a counter.  The first time we have the problem,
   during a symbol read, we report it.  At the end of symbol reading,
   if verbose, we report how many of each problem we had.  */

struct complaint
{
    char * message;
    unsigned counter;
    struct complaint * next;
};

typedef unsigned int CORE_ADDR;
typedef unsigned int DIE_REF;   /* Reference to a DIE */
typedef char BLOCK;

struct dieinfo
{
    char * die;         /* Pointer to the raw DIE data */
    unsigned int die_length;    /* Length of the raw DIE data */
    DIE_REF die_ref;        /* Offset of this DIE */
    unsigned short die_tag; /* Tag for this DIE */
    unsigned int at_padding;
    unsigned int at_sibling;
    BLOCK * at_location;
    char * at_name;
    unsigned short at_fund_type;
    BLOCK * at_mod_fund_type;
    unsigned int at_user_def_type;
    BLOCK * at_mod_u_d_type;
    unsigned short at_ordering;
    BLOCK * at_subscr_data;
    unsigned int at_byte_size;
    unsigned short at_bit_offset;
    unsigned int at_bit_size;
    BLOCK * at_element_list;
    unsigned int at_stmt_list;
    CORE_ADDR at_low_pc;
    CORE_ADDR at_high_pc;
    unsigned int at_language;
    unsigned int at_member;
    unsigned int at_discr;
    BLOCK * at_discr_value;
    BLOCK * at_string_length;
    char * at_comp_dir;
    char * at_producer;
    unsigned int at_start_scope;
    unsigned int at_stride_size;
    unsigned int at_src_info;
    char * at_prototyped;
    unsigned int has_at_low_pc:1;
    unsigned int has_at_stmt_list:1;
    unsigned int has_at_byte_size:1;
    unsigned int short_element_list:1;

    /* Kludge to identify register variables */

    unsigned int isreg;

    /* Kludge to identify optimized out variables */

    unsigned int optimized_out;

    /* Kludge to identify basereg references.
       Nonzero if we have an offset relative to a basereg.  */

    unsigned int offreg;

    /* Kludge to identify which base register is it relative to.  */

    unsigned int basereg;
};

/* Codes for `fundamental types'.  This is a monstrosity based on the
   bogus notion that there are certain compiler-independent
   `fundamental types'.  None of these is well-defined (how big is
   FT_SHORT?  Does it depend on the language?  How does the
   language-specific code know which type to correlate to FT_SHORT?)  */

#define FT_VOID         0 /* comment */
#define FT_BOOLEAN      1 /* comment */
#define FT_CHAR         2   /* we use this for not-unsigned C/C++ chars */
#define FT_SIGNED_CHAR      3   /* we use this for C++ signed chars */
#define FT_UNSIGNED_CHAR    4   /* we use this for C/C++ unsigned chars */
#define FT_SHORT        5 /* comment */
#define FT_SIGNED_SHORT     6 /* comment */
#define FT_UNSIGNED_SHORT   7 /* comment */
#define FT_INTEGER      8 /* comment */
#define FT_SIGNED_INTEGER   9 /* comment */
#define FT_UNSIGNED_INTEGER 10 /* comment */
#define FT_LONG         11 /* comment */
#define FT_SIGNED_LONG      12 /* comment */
#define FT_UNSIGNED_LONG    13 /* comment */
#define FT_LONG_LONG        14 /* comment */
#define FT_SIGNED_LONG_LONG 15 /* comment */
#define FT_UNSIGNED_LONG_LONG   16 /* comment */
#define FT_FLOAT        17 /* comment */
#define FT_DBL_PREC_FLOAT   18 /* comment */
#define FT_EXT_PREC_FLOAT   19 /* comment */
#define FT_COMPLEX      20 /* comment */
#define FT_DBL_PREC_COMPLEX 21 /* comment */
#define FT_EXT_PREC_COMPLEX 22 /* comment */
#define FT_STRING       23 /* comment */
#define FT_FIXED_DECIMAL    24 /* comment */
#define FT_FLOAT_DECIMAL    25 /* comment */
#define FT_BYTE         26 /* comment */
#define FT_UNSIGNED_BYTE    27 /* comment */
#define FT_TEMPLATE_ARG     28 /* comment */

#define FT_NUM_MEMBERS      29  /* Highest FT_* above, plus one. */

/* Some macros for char-based bitfields.  */

#define B_SET(a,x)  ((a)[(x)>>3] |= (1 << ((x)&7))) /* comment */
#define B_CLR(a,x)  ((a)[(x)>>3] &= ~(1 << ((x)&7))) /* comment */
#define B_TST(a,x)  ((a)[(x)>>3] & (1 << ((x)&7))) /* comment */
#define B_TYPE      unsigned char
#define B_BYTES(x)  ( 1 + ((x)>>3) ) /* comment */
#define B_CLRALL(a,x)   memset ((a), 0, B_BYTES(x))

/* Different kinds of data types are distinguished by the `code' field.  */

enum type_code
{
    TYPE_CODE_UNDEF,        /* Not used; catches errors */
    TYPE_CODE_PTR,      /* Pointer type */
    TYPE_CODE_ARRAY,        /* Array type with lower & upper bounds. */
    TYPE_CODE_STRUCT,       /* C struct or Pascal record */
    TYPE_CODE_UNION,        /* C union or Pascal variant part */
    TYPE_CODE_ENUM,     /* Enumeration type */
    TYPE_CODE_FUNC,     /* Function type */
    TYPE_CODE_INT,      /* Integer type */

    /* Floating type.  This is *NOT* a complex type.  Beware, there are parts
    of GDB which bogusly assume that TYPE_CODE_FLT can mean complex.  */
    TYPE_CODE_FLT,

    /* Void type.  The length field specifies the length (probably always
    one) which is used in pointer arithmetic involving pointers to
    this type, but actually dereferencing such a pointer is invalid;
    a void type has no length and no actual representation in memory
    or registers.  A pointer to a void type is a generic pointer.  */
    TYPE_CODE_VOID,

    TYPE_CODE_SET,      /* Pascal sets */
    TYPE_CODE_RANGE,        /* Range (integers within spec'd bounds) */

    /* A string type which is like an array of character but prints
    differently (at least for (OBSOLETE) CHILL (OBSOLETE)).  It
    does not contain a length field as Pascal strings (for many
    Pascals, anyway) do; if we want to deal with such strings, we
    should use a new type code.  */
    TYPE_CODE_STRING,

    /* String of bits; like TYPE_CODE_SET but prints differently (at
    least for (OBSOLETE) CHILL (OBSOLETE)).  */
    TYPE_CODE_BITSTRING,

    /* Unknown type.  The length field is valid if we were able to
    deduce that much about the type, or 0 if we don't even know that.  */
    TYPE_CODE_ERROR,

    /* C++ */
    TYPE_CODE_MEMBER,       /* Member type */
    TYPE_CODE_METHOD,       /* Method type */
    TYPE_CODE_REF,      /* C++ Reference types */

    TYPE_CODE_CHAR,     /* *real* character type */

    /* Boolean type.  0 is false, 1 is true, and other values are non-boolean
    (e.g. FORTRAN "logical" used as unsigned int).  */
    TYPE_CODE_BOOL,

    /* Fortran */
    TYPE_CODE_COMPLEX,      /* Complex float */

    TYPE_CODE_TYPEDEF,
    TYPE_CODE_TEMPLATE,     /* C++ template */
    TYPE_CODE_TEMPLATE_ARG  /* C++ template arg */
};

#define TYPE_FLAGS(thistype)  (thistype->pmain_type)->flags
#define TYPE_INSTANCE_FLAGS(thistype) (thistype)->instance_flags

#define TYPE_CODE_CLASS TYPE_CODE_STRUCT

/* Some bits for the type's flags word, and macros to test them. */

/* Unsigned integer type.  If this is not set for a TYPE_CODE_INT, the
   type is signed (unless TYPE_FLAG_NOSIGN (below) is set). */

#define TYPE_FLAG_UNSIGNED  (1 << 0)
#define TYPE_UNSIGNED(t)    (TYPE_FLAGS (t) & TYPE_FLAG_UNSIGNED)

/* No sign for this type.  In C++, "char", "signed char", and "unsigned
   char" are distinct types; so we need an extra flag to indicate the
   absence of a sign! */

#define TYPE_FLAG_NOSIGN    (1 << 1)
#define TYPE_NOSIGN(t)      (TYPE_FLAGS (t) & TYPE_FLAG_NOSIGN)

/* This appears in a type's flags word if it is a stub type (e.g., if
   someone referenced a type that wasn't defined in a source file
   via (struct sir_not_appearing_in_this_film *)).  */

#define TYPE_FLAG_STUB      (1 << 2) /* comment */
#define TYPE_STUB(t)        (TYPE_FLAGS (t) & TYPE_FLAG_STUB)

/* The target type of this type is a stub type, and this type needs to
   be updated if it gets un-stubbed in check_typedef.
   Used for arrays and ranges, in which TYPE_LENGTH of the array/range
   gets set based on the TYPE_LENGTH of the target type.
   Also, set for TYPE_CODE_TYPEDEF. */

#define TYPE_FLAG_TARGET_STUB   (1 << 3) /* comment */
#define TYPE_TARGET_STUB(t) (TYPE_FLAGS (t) & TYPE_FLAG_TARGET_STUB)

/* Static type.  If this is set, the corresponding type had
 * a static modifier.
 * Note: This may be unnecessary, since static data members
 * are indicated by other means (bitpos == -1)
 */

#define TYPE_FLAG_STATIC    (1 << 4) /* comment */
#define TYPE_STATIC(t)      (TYPE_FLAGS (t) & TYPE_FLAG_STATIC)

/* Constant type.  If this is set, the corresponding type has a
 * const modifier.
 */

#define TYPE_FLAG_CONST     (1 << 5) /* comment */
#define TYPE_CONST(t)       (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_CONST)

/* Volatile type.  If this is set, the corresponding type has a
 * volatile modifier.
 */

#define TYPE_FLAG_VOLATILE  (1 << 6) /* comment */
#define TYPE_VOLATILE(t)    (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_VOLATILE)

/* This is a function type which appears to have a prototype.  We need this
   for function calls in order to tell us if it's necessary to coerce the args,
   or to just do the standard conversions.  This is used with a short field. */

#define TYPE_FLAG_PROTOTYPED    (1 << 7) /* comment */
#define TYPE_PROTOTYPED(t)  (TYPE_FLAGS (t) & TYPE_FLAG_PROTOTYPED)

/* This flag is used to indicate that processing for this type
   is incomplete.

   (Mostly intended for HP platforms, where class methods, for
   instance, can be encountered before their classes in the debug
   info; the incomplete type has to be marked so that the class and
   the method can be assigned correct types.) */

#define TYPE_FLAG_INCOMPLETE    (1 << 8) /* comment */
#define TYPE_INCOMPLETE(t)  (TYPE_FLAGS (t) & TYPE_FLAG_INCOMPLETE)

/* Instruction-space delimited type.  This is for Harvard architectures
   which have separate instruction and data address spaces (and perhaps
   others).

   GDB usually defines a flat address space that is a superset of the
   architecture's two (or more) address spaces, but this is an extension
   of the architecture's model.

   If TYPE_FLAG_INST is set, an object of the corresponding type
   resides in instruction memory, even if its address (in the extended
   flat address space) does not reflect this.

   Similarly, if TYPE_FLAG_DATA is set, then an object of the
   corresponding type resides in the data memory space, even if
   this is not indicated by its (flat address space) address.

   If neither flag is set, the default space for functions / methods
   is instruction space, and for data objects is data memory.  */

#define TYPE_FLAG_CODE_SPACE    (1 << 9) /* comment */
#define TYPE_CODE_SPACE(t)  (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_CODE_SPACE)

#define TYPE_FLAG_DATA_SPACE    (1 << 10) /* comment */
#define TYPE_DATA_SPACE(t)  (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_DATA_SPACE)

/* FIXME drow/2002-06-03:  Only used for methods, but applies as well
   to functions.  */

#define TYPE_FLAG_VARARGS   (1 << 11) /* comment */
#define TYPE_VARARGS(t)     (TYPE_FLAGS (t) & TYPE_FLAG_VARARGS)

/* Identify a vector type.  Gcc is handling this by adding an extra
   attribute to the array type.  We slurp that in as a new flag of a
   type.  This is used only in dwarf2read.c.  */

⌨️ 快捷键说明

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