dwarf2.h
来自「主要用于在线分析dsp目标代码的调试信息。DSP平台下用CCS调试源代码时」· C头文件 代码 · 共 1,613 行 · 第 1/4 页
H
1,613 行
A value of -1 or -2 indicates a static field; -1 means the location
is specified by the label loc.physname; -2 means that loc.physaddr
specifies the actual address. */
int bitsize;
/* In a struct or union type, type of this field.
In a function or member type, type of this argument.
In an array type, the domain-type of the array. */
struct type * ptype;
/* Name of field, value or argument.
NULL for range bounds, array domains, and member function
arguments. */
char * name;
};
struct nextfield
{
struct nextfield * next;
int accessibility;
int virtuality;
struct field field;
};
struct nextfnfield
{
struct nextfnfield * next;
struct fn_field fnfield;
};
struct fnfieldlist
{
char * name;
int length;
struct nextfnfield * head;
};
/* The routines that read and process dies for a C struct or C++ class
pass lists of data member fields and lists of member function fields
in an instance of a field_info structure, as defined below. */
struct field_info
{
/* List of data member and baseclasses fields. */
struct nextfield * fields;
/* Number of fields. */
int nfields;
/* Number of baseclasses. */
int nbaseclasses;
/* Set if the accesibility of one of the fields is not public. */
int non_public_fields;
/* Member function fields array, entries are allocated in the order they
are encountered in the object file. */
struct nextfnfield * fnfields;
/* Member function fieldlist array, contains name of possibly overloaded
member function, number of overloaded member functions and a pointer
to the head of the member function field chain. */
struct fnfieldlist * fnfieldlists;
/* Number of entries in the fnfieldlists array. */
int nfnfields;
};
#define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->fields[n]
#define FIELD_TYPE(thisfld) ((thisfld).ptype)
#define FIELD_NAME(thisfld) ((thisfld).name)
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
#define FIELD_ARTIFICIAL(thisfld) ((thisfld).loc.artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define TYPE_INSTANCE_FLAGS(thistype) (thistype)->instance_flags
#define TYPE_MAIN_TYPE(thistype) (thistype)->pmain_type
#define TYPE_NAME(thistype) TYPE_MAIN_TYPE(thistype)->name
#define TYPE_TAG_NAME(type) TYPE_MAIN_TYPE(type)->tag_name
#define TYPE_TARGET_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->target_type
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
#define TYPE_CHAIN(thistype) (thistype)->chain
/* Note that if thistype is a TYPEDEF type, you have to call check_typedef.
But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
so you only have to call check_typedef once. Since allocate_value
calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */
#define TYPE_LENGTH(thistype) TYPE_MAIN_TYPE(thistype)->length
#define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile
/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
type, you need to do TYPE_CODE (check_type (this_type)). */
#define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code
#define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
#define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->fields
#define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args
#define TYPE_INSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->instantiations
#define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0)
#define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0)
#define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1)
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
#define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->fields[n]
#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
#define TYPE_VPTR_FIELDNO(thistype) TYPE_MAIN_TYPE(thistype)->vptr_fieldno
#define TYPE_CPLUS_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff
#define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
#define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) || \
(TYPE_CODE (thistype) == TYPE_CODE_UNION)) && \
(TYPE_NFIELDS (thistype) == 0) && \
(TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
#define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
/* Special block numbers */
#define GLOBAL_BLOCK 0 /* comment */
#define STATIC_BLOCK 1 /* comment */
#define FIRST_LOCAL_BLOCK 2 /* comment */
struct block
{
/* Addresses in the executable code that are in this block. */
CORE_ADDR startaddr;
CORE_ADDR endaddr;
/* The symbol that names this block, if the block is the body of a
function; otherwise, zero. */
struct symbol * function;
/* The `struct block' for the containing block, or 0 if none.
The superblock of a top-level local block (i.e. a function in the
case of C) is the STATIC_BLOCK. The superblock of the
STATIC_BLOCK is the GLOBAL_BLOCK. */
struct block * superblock;
/* The symbols for this block are either in a simple linear list or
in a simple hashtable. Blocks which correspond to a function
(which have a list of symbols corresponding to arguments) use
a linear list, as do some older symbol readers (currently only
mdebugread and dstread). Other blocks are hashed.
The hashtable uses the same hash function as the minsym hashtables,
found in minsyms.c:minsym_hash_iw. Symbols are hashed based on
their demangled name if appropriate, and on their name otherwise.
The hash function ignores space, and stops at the beginning of the
argument list if any.
The table is laid out in NSYMS/5 buckets and symbols are chained via
their hash_next field. */
/* If this is really a hashtable of the symbols, this flag is 1. */
unsigned char hashtable;
/* Number of local symbols. */
int nsyms;
/* The symbols. If some of them are arguments, then they must be
in the order in which we would like to print them. */
struct symbol * sym[1];
};
enum address_class
{
/* Not used; catches errors */
LOC_UNDEF,
/* Value is constant int SYMBOL_VALUE, host byteorder */
LOC_CONST,
/* Value is at fixed address SYMBOL_VALUE_ADDRESS */
LOC_STATIC,
/* Value is in register. SYMBOL_VALUE is the register number. */
LOC_REGISTER,
/* It's an argument; the value is at SYMBOL_VALUE offset in arglist. */
LOC_ARG,
/* Value address is at SYMBOL_VALUE offset in arglist. */
LOC_REF_ARG,
/* Value is in register number SYMBOL_VALUE. Just like LOC_REGISTER
except this is an argument. Probably the cleaner way to handle
this would be to separate address_class (which would include
separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
FRAME_LOCALS_ADDRESS), and an is_argument flag.
For some symbol formats (stabs, for some compilers at least),
the compiler generates two symbols, an argument and a register.
In some cases we combine them to a single LOC_REGPARM in symbol
reading, but currently not for all cases (e.g. it's passed on the
stack and then loaded into a register). */
LOC_REGPARM,
/* Value is in specified register. Just like LOC_REGPARM except the
register holds the address of the argument instead of the argument
itself. This is currently used for the passing of structs and unions
on sparc and hppa. It is also used for call by reference where the
address is in a register, at least by mipsread.c. */
LOC_REGPARM_ADDR,
/* Value is a local variable at SYMBOL_VALUE offset in stack frame. */
LOC_LOCAL,
/* Value not used; definition in SYMBOL_TYPE. Symbols in the namespace
STRUCT_NAMESPACE all have this class. */
LOC_TYPEDEF,
/* Value is address SYMBOL_VALUE_ADDRESS in the code */
LOC_LABEL,
/* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
of the block. Function names have this class. */
LOC_BLOCK,
/* Value is a constant byte-sequence pointed to by SYMBOL_VALUE_BYTES, in
target byte order. */
LOC_CONST_BYTES,
/* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
arglist (FRAME_ARGS_ADDRESS). Added for i960, which passes args
in regs then copies to frame. */
LOC_LOCAL_ARG,
/* Value is at SYMBOL_VALUE offset from the current value of
register number SYMBOL_BASEREG. This exists mainly for the same
things that LOC_LOCAL and LOC_ARG do; but we need to do this
instead because on 88k DWARF gives us the offset from the
frame/stack pointer, rather than the offset from the "canonical
frame address" used by COFF, stabs, etc., and we don't know how
to convert between these until we start examining prologues.
Note that LOC_BASEREG is much less general than a DWARF expression.
We don't need the generality (at least not yet), and storing a general
DWARF expression would presumably take up more space than the existing
scheme. */
LOC_BASEREG,
/* Same as LOC_BASEREG but it is an argument. */
LOC_BASEREG_ARG,
/* Value is at fixed address, but the address of the variable has
to be determined from the minimal symbol table whenever the
variable is referenced.
This happens if debugging information for a global symbol is
emitted and the corresponding minimal symbol is defined
in another object file or runtime common storage.
The linker might even remove the minimal symbol if the global
symbol is never referenced, in which case the symbol remains
unresolved. */
LOC_UNRESOLVED,
/* Value is at a thread-specific location calculated by a
target-specific method. */
LOC_THREAD_LOCAL_STATIC,
/* The variable does not actually exist in the program.
The value is ignored. */
LOC_OPTIMIZED_OUT,
/* The variable is static, but actually lives at * (address).
* I.e. do an extra indirection to get to it.
* This is used on HP-UX to get at globals that are allocated
* in shared libraries, where references from images other
* than the one where the global was allocated are done
* with a level of indirection.
*/
LOC_INDIRECT
};
typedef enum
{
/* UNDEF_NAMESPACE is used when a namespace has not been discovered or
none of the following apply. This usually indicates an error either
in the symbol information or in gdb's handling of symbols. */
UNDEF_NAMESPACE,
/* VAR_NAMESPACE is the usual namespace. In C, this contains variables,
function names, typedef names and enum type values. */
VAR_NAMESPACE,
/* STRUCT_NAMESPACE is used in C to hold struct, union and enum type names.
Thus, if `struct foo' is used in a C program, it produces a symbol named
`foo' in the STRUCT_NAMESPACE. */
STRUCT_NAMESPACE,
/* LABEL_NAMESPACE may be used for names of labels (for gotos);
currently it is not used and labels are not recorded at all. */
LABEL_NAMESPACE,
/* Searching namespaces. These overlap with VAR_NAMESPACE, providing
some granularity with the search_symbols function. */
/* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
METHODS_NAMESPACE */
VARIABLES_NAMESPACE,
/* All functions -- for some reason not methods, though. */
FUNCTIONS_NAMESPACE,
/* All defined types */
TYPES_NAMESPACE,
/* All class methods -- why is this separated out? */
METHODS_NAMESPACE
}
namespace_enum;
struct symbol
{
char * name; /* 符号名称 */
CORE_ADDR address; /* 符号地址 */
struct type * ptype; /* 符号类型 */
union{
/* The fact that this is a long not a LONGEST mainly limits the
range of a LOC_CONST. Since LOC_CONST_BYTES exists, I'm not
sure that is a big deal. */
int ivalue;
struct block * block;
char * bytes;
CORE_ADDR address;
/* for opaque typedef struct chain */
struct symbol * chain;
}value;
namespace_enum namespace;
enum address_class aclass;
struct symbol * hash_next; /* hash */
};
#define PENDINGSIZE 100 /* comment */
struct pending
{
struct pending * next;
int nsyms;
struct symbol * psymbol[PENDINGSIZE];
};
#define SYMBOL_NAME(symbol) (symbol)->name
#define SYMBOL_VALUE(symbol) (symbol)->value.ivalue
#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace
#define SYMBOL_CLASS(symbol) (symbol)->aclass
#define SYMBOL_TYPE(symbol) (symbol)->ptype
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
#define SYMBOL_ALIASES(symbol) (symbol)->aliases
#define SYMBOL_RANGES(symbol) (symbol)->ranges
#define SYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
#define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->value.address
#ifndef NULL
#define NULL 0 /* comment */
#endif
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?