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

📄 armdbg.h

📁 这个是LINUX下的GDB调度工具的源码
💻 H
📖 第 1 页 / 共 4 页
字号:
               F_Internal,                               /* new fpe : mostly as extended */               F_None } Dbg_FPType;typedef struct { ARMword w[3]; } Dbg_TargetExtendedVal;typedef struct { ARMword w[3]; } Dbg_TargetPackedVal;typedef struct { ARMword w[2]; } Dbg_TargetDoubleVal;typedef struct { ARMword w[1]; } Dbg_TargetFloatVal;typedef union { Dbg_TargetExtendedVal e; Dbg_TargetPackedVal p;                Dbg_TargetDoubleVal d; Dbg_TargetFloatVal f; } Dbg_TargetFPVal;#define TargetSizeof_Extended 12#define TargetSizeof_Packed   12#define TargetSizeof_Double   8#define TargetSizeof_Float    4typedef struct Dbg_FPRegVal {     Dbg_FPType type;     Dbg_TargetFPVal v;} Dbg_FPRegVal;typedef struct Dbg_FPRegSet {    Dbg_FPRegVal f[8];    ARMword fpsr, fpcr;} Dbg_FPRegSet;Dbg_Error Dbg_ReadFPRegisters(Dbg_MCState *state, Dbg_FPRegSet *regs);Dbg_Error Dbg_WriteFPRegisters(Dbg_MCState *state, int32 mask, Dbg_FPRegSet *regs);Dbg_Error Dbg_FPRegToDouble(DbleBin *d, Dbg_FPRegVal const *f);/* Converts from a FP register value (in any format) to a double with   approximately the same value (or returns Dbg_Err_Overflow) */void Dbg_DoubleToFPReg(Dbg_FPRegVal *f, DbleBin const *d);/* Converts the double <d> to a Dbg_FPRegVal with type F_Extended *//*--------------------------------------------------------------------------*/#include "dbg_cp.h"Dbg_Error Dbg_DescribeCoPro(Dbg_MCState *state, int cpnum, Dbg_CoProDesc *p);Dbg_Error Dbg_DescribeCoPro_RDI(Dbg_MCState *state, int cpnum, Dbg_CoProDesc *p);Dbg_Error Dbg_ReadCPRegisters(Dbg_MCState *state, int cpnum, ARMword *regs);Dbg_Error Dbg_WriteCPRegisters(Dbg_MCState *state, int cpnum, int32 mask, ARMword *regs);/*--------------------------------------------------------------------------*/Dbg_Error Dbg_ReadWords(    Dbg_MCState *state,    ARMword *words, ARMaddress addr, unsigned count);/* Reads a number of (32-bit) words from target store.  The values are in host   byte order; if they are also to be interpreted as bytes Dbg_SwapByteOrder()   must be called to convert to target byte order. */Dbg_Error Dbg_WriteWords(    Dbg_MCState *state,    ARMaddress addr, const ARMword *words, unsigned count);/* Writes a number of (32-bit) words to target store.  The values are in host   byte order (if what is being written is actually a byte string it must be   converted by Dbg_SwapByteOrder()). */Dbg_Error Dbg_ReadHalf(Dbg_MCState *state, ARMhword *val, ARMaddress addr);Dbg_Error Dbg_WriteHalf(Dbg_MCState *state, ARMaddress addr, ARMword val);Dbg_Error Dbg_ReadBytes(Dbg_MCState *state, Dbg_Byte *val, ARMaddress addr, unsigned count);Dbg_Error Dbg_WriteBytes(Dbg_MCState *state, ARMaddress addr, const Dbg_Byte *val, unsigned count);void Dbg_HostWords(Dbg_MCState *state, ARMword *words, unsigned wordcount);/* (A noop unless host and target bytesexes differ) */ARMword Dbg_HostWord(Dbg_MCState *state, ARMword v);ARMhword Dbg_HostHalf(Dbg_MCState *state, ARMword v);/*--------------------------------------------------------------------------*//* Types describing various aspects of position within code.   There are rather a lot of these, in the interests of describing precisely   what fields must be present (rather than having a single type with many   fields which may or may not be valid according to context). */typedef struct Dbg_LLPos {    Dbg_SymTable *st;    char *llsym;    ARMaddress offset;} Dbg_LLPos;typedef struct Dbg_File {    Dbg_SymTable *st;    char *file;} Dbg_File;typedef struct Dbg_Line {    unsigned32 line;      /* linenumber in the file */    unsigned16 statement, /* within the line (1-based) */               charpos;   /* ditto */} Dbg_Line;/* As an output value from toolbox functions, both statement and charpos are set   if the version of the debugger tables for the section concerned permits.   On input, <charpos> is used only if <statement> is 0 (in which case, if   <charpos> is non-0, Dbg_Err_DbgTableVersion is returned if the version of   the debugger tables concerned is too early. */typedef struct Dbg_FilePos {    Dbg_File f;    Dbg_Line line;} Dbg_FilePos;typedef struct Dbg_ProcDesc {    Dbg_File f;    char *name;} Dbg_ProcDesc;typedef struct Dbg_ProcPos {    Dbg_ProcDesc p;    Dbg_Line line;} Dbg_ProcPos;/* Support for conversions between position representations */Dbg_Error Dbg_ProcDescToLine(Dbg_MCState *state, Dbg_ProcDesc *proc, Dbg_Line *line);/* If proc->f.file is null (and there is just one function proc->name), it is   updated to point to the name of the file containing (the start of)   proc->name. */Dbg_Error Dbg_FilePosToProc(Dbg_MCState *state, const Dbg_FilePos *pos, char **procname);/* Conversions from position representations to and from code addresses */Dbg_Error Dbg_AddressToProcPos(    Dbg_MCState *state, ARMaddress addr,    Dbg_ProcPos *pos);Dbg_Error Dbg_AddressToLLPos(    Dbg_MCState *state, ARMaddress addr,    Dbg_LLPos *pos, Dbg_LLSymType *res_type, int system_names);Dbg_Error Dbg_ProcPosToAddress(    Dbg_MCState *state, const Dbg_ProcPos *pos,    ARMaddress *res);Dbg_Error Dbg_LLPosToAddress(    Dbg_MCState *state, const Dbg_LLPos *pos,    ARMaddress *res);typedef struct {    ARMaddress start, end;} Dbg_AddressRange;typedef Dbg_Error Dbg_AddressRangeProc(void *arg, int32 first, int32 last, Dbg_AddressRange const *range);Dbg_Error Dbg_MapAddressRangesForFileRange(    Dbg_MCState *state,    Dbg_SymTable *st, const char *f, int32 first, int32 last, Dbg_AddressRangeProc *p, void *arg);typedef struct Dbg_Environment Dbg_Environment;/* A Dbg_Environment describes the context required to make sense of a variable   name and access its value.  Its format is not revealed.  Dbg_Environment   values are allocated by Dbg_NewEnvironment() and discarded by   Dbg_DeleteEnvironment(). */Dbg_Environment *Dbg_NewEnvironment(Dbg_MCState *state);void Dbg_DeleteEnvironment(Dbg_MCState *state, Dbg_Environment *env);Dbg_Error Dbg_StringToEnv(    Dbg_MCState *state, char *str, Dbg_Environment *resenv,    int forcontext, Dbg_Environment const *curenv);Dbg_Error Dbg_ProcPosToEnvironment(    Dbg_MCState *state, const Dbg_ProcPos *pos, int activation,    const Dbg_Environment *current, Dbg_Environment *res);/* Conversion from a position representation to an Dbg_Environment (as required   to access variable values).  Only a Dbg_ProcPos argument here; other   representations need to be converted first.   Returns <res> describing the <activation>th instance of the function   described by <pos>, up from the stack base if <activation> is negative,   else down from <current>.   If this function returns Dbg_Err_ActivationNotPresent, the result   Dbg_Environment is still valid for accessing non-auto variables. */typedef struct Dbg_DeclSpec Dbg_DeclSpec;Dbg_Error Dbg_EnvToProcItem(    Dbg_MCState *state, Dbg_Environment const *env, Dbg_DeclSpec *proc);Dbg_Error Dbg_ContainingEnvironment(    Dbg_MCState *state, const Dbg_Environment *context, Dbg_Environment *res);/* Set <res> to describe the containing function, file if <context> is within   a top-level function (or error if <context> already describes a file). *//*--------------------------------------------------------------------------*//* ASD debug table pointers are not by themselves sufficient description,   since there's an implied section context.  Hence the DeclSpec and TypeSpec   structures. */#ifndef Dbg_TypeSpec_Definedstruct Dbg_DeclSpec { void *a; };#ifdef CALLABLE_COMPILERtypedef void *Dbg_TypeSpec;/* The intention here is to give an alternative definition for Dbg_BasicType   which follows. */#define Dbg_T_Void      xDbg_T_Void#define Dbg_T_Bool      xDbg_T_Bool#define Dbg_T_SByte     xDbg_T_SByte#define Dbg_T_SHalf     xDbg_T_Half#define Dbg_T_SWord     xDbg_T_SWord#define Dbg_T_UByte     xDbg_T_UByte#define Dbg_T_UHalf     xDbg_T_UHalf#define Dbg_T_UWord     xDbg_T_UWord#define Dbg_T_Float     xDbg_T_Float#define Dbg_T_Double    xDbg_T_Double#define Dbg_T_LDouble   xDbg_T_LDouble#define Dbg_T_Complex   xDbg_T_Complex#define Dbg_T_DComplex  xDbg_T_DComplex#define Dbg_T_String    xDbg_T_String#define Dbg_T_Function  xDbg_T_Function#define Dbg_BasicType   xDbg_BaiscType#define Dbg_PrimitiveTypeToTypeSpec xDbg_PrimitiveTypeToTypeSpec#else/* We want a Dbg_TypeSpec to be a an opaque type, but of known size (so the   toolbox's clients can allocate the store to hold one); unfortunately, we   can do this only by having one definition for the toolbox's clients and   one (elsewhere) for the toolbox itself. */typedef struct Dbg_TypeSpec Dbg_TypeSpec;struct Dbg_TypeSpec { void *a; int32 b; };#endif /* CALLABLE_COMPILER */typedef enum {    Dbg_T_Void,    Dbg_T_Bool,    Dbg_T_SByte,    Dbg_T_SHalf,    Dbg_T_SWord,    Dbg_T_UByte,    Dbg_T_UHalf,    Dbg_T_UWord,    Dbg_T_Float,    Dbg_T_Double,    Dbg_T_LDouble,    Dbg_T_Complex,    Dbg_T_DComplex,    Dbg_T_String,    Dbg_T_Function} Dbg_BasicType;#endifvoid Dbg_PrimitiveTypeToTypeSpec(Dbg_TypeSpec *ts, Dbg_BasicType t);bool Dbg_TypeIsIntegral(Dbg_TypeSpec const *ts);bool Dbg_TypeIsPointer(Dbg_TypeSpec const *ts);bool Dbg_TypeIsFunction(Dbg_TypeSpec const *ts);bool Dbg_PruneType(Dbg_TypeSpec *tsres, Dbg_TypeSpec const *ts);/* Return to tsres a version of ts which has been pruned by the removal of all   toplevel typedefs. Result is YES if the result has changed. */typedef Dbg_Error Dbg_FileProc(Dbg_MCState *state, const char *name, const Dbg_DeclSpec *procdef, void *arg);Dbg_Error Dbg_EnumerateFiles(Dbg_MCState *state, Dbg_SymTable *st, Dbg_FileProc *p, void *arg);/* The top level for a high level enumerate.  Lower levels are performed by   EnumerateDeclarations (below). */typedef enum {    ds_Invalid,    ds_Type,    ds_Var,    ds_Proc,    ds_Enum,    ds_Function,    ds_Label} Dbg_DeclSort;Dbg_DeclSort Dbg_SortOfDeclSpec(Dbg_DeclSpec const *decl);char *Dbg_NameOfDeclSpec(Dbg_DeclSpec const *decl);Dbg_TypeSpec Dbg_TypeSpecOfDeclSpec(Dbg_DeclSpec const *decl);typedef enum {    cs_None,    cs_Extern,    cs_Static,    cs_Auto,    cs_Reg,    cs_Var,    cs_Farg,    cs_Fcarg,    cs_Local,    cs_Filtered,    cs_Globalreg} Dbg_StgClass;Dbg_StgClass Dbg_StgClassOfDeclSpec(Dbg_DeclSpec const *decl);bool Dbg_VarsAtSameAddress(Dbg_DeclSpec const *d1, Dbg_DeclSpec const *d2);bool Dbg_VarsDecribedForDeclSpec(Dbg_DeclSpec const *decl);int Dbg_ArgCountOfDeclSpec(Dbg_DeclSpec const *decl);typedef struct Dbg_DComplex { DbleBin r, i; } Dbg_DComplex;typedef union Dbg_ConstantVal {    int32 l;    unsigned32 u;    DbleBin d;    Dbg_DComplex fc;    ARMaddress a;    char *s;} Dbg_ConstantVal;typedef struct Dbg_Constant {    Dbg_TypeSpec type;    Dbg_ConstantVal val;} Dbg_Constant;typedef enum Dbg_ValueSort {    vs_register,    vs_store,    vs_constant,    vs_local,    vs_filtered,    vs_none,    vs_error} Dbg_ValueSort;/* vs_local allows the use of symbol table entries to describe entities within

⌨️ 快捷键说明

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