📄 armdbg.h
字号:
the debugger's own address space, accessed in the same way as target variables. vs_filtered describes entities which may be read or written only via an access function (eg r15) */#define fpr_base 16/* There's only one register ValueSort (reflecting asd table StgClass); fp register n is encoded as register n+fpr_base. */typedef struct Dbg_Value Dbg_Value;typedef Dbg_Error Dbg_AccessFn(Dbg_MCState *state, int write, Dbg_Value *self, Dbg_Constant *c);/* <write> == 0: read a vs_filtered value, updating the value self. <write> == 1: update a vs_filtered value, with the value described by c. <self> allows use of the same Dbg_AccessFn for several different entities (using different val.f.id fields). */typedef Dbg_Error Dbg_FormatFn(int decode, char *b, ARMword *valp, void *formatarg);typedef struct { Dbg_AccessFn *f; int id; } Dbg_AccessFnRec;struct Dbg_Value { Dbg_TypeSpec type; Dbg_ValueSort sort; Dbg_FormatFn *formatp; void *formatarg; int f77csize; union { struct { int no; ARMaddress frame; } r; ARMaddress ptr; Dbg_ConstantVal c; void *localp; Dbg_AccessFnRec f; Dbg_Error err; } val;};Dbg_Error Dbg_AddLLSymbol(Dbg_SymTable *st, char const *name, Dbg_LLSymType type, ARMword val);Dbg_Error Dbg_AddSymbol(Dbg_SymTable *st, char const *name, Dbg_Value const *val);typedef struct Dbg_DeclSpecF { Dbg_DeclSpec decl; Dbg_FormatFn *formatp; void *formatarg;} Dbg_DeclSpecF;typedef Dbg_Error Dbg_DeclProc(Dbg_MCState *state, Dbg_Environment const *context, Dbg_DeclSpecF const *var, Dbg_DeclSort sort, int masked, void *arg);Dbg_Error Dbg_EnumerateDeclarations(Dbg_MCState *state, Dbg_Environment const *context, Dbg_DeclProc *p, void *arg);/* call p once for every declaration local to the function described by <context> (or file if <context> describes a place outside a function). p's argument <masked> is true if the variable is not visible, thanks to a declaration in an inner scope. */Dbg_Error Dbg_ValueOfVar(Dbg_MCState *state, const Dbg_Environment *context, const Dbg_DeclSpec *var, Dbg_Value *val);/* Different from Dbg_EvalExpr() in that the thing being evaluated is described by a Dbg_DeclSpec (which must be for a variable), rather than a string needing to be decoded and associated with a symbol-table item. Intended to be called from a Dbg_DeclProc called from Dbg_EnumerateDeclarations. */Dbg_Error Dbg_EvalExpr(Dbg_MCState *state, Dbg_Environment const *context, char const *expr, int flags, Dbg_Value *val);Dbg_Error Dbg_EvalExpr_ep(Dbg_MCState *state, Dbg_Environment const *context, char const *expr, char **exprend, int flags, Dbg_Value *val);/* Both Dbg_ValueOfVar and Dbg_EvalExpr mostly deliver a value still containing an indirection (since it may be wanted as the lhs of an assignment) */void Dbg_RealLocation(Dbg_MCState *state, Dbg_Value *val);/* If val describes a register, this may really be a register, or a place on the stack where the register's value is saved. In the latter case, val is altered to describe the save place. (In all others, it remains unchanged). */Dbg_Error Dbg_DereferenceValue(Dbg_MCState *state, const Dbg_Value *value, Dbg_Constant *c);/* This fails if <value> describes a structure or array, returning Dbg_Err_TypeNotSimple */typedef struct Dbg_Expr Dbg_Expr;/* The result of parsing an expression in an environment: its structure is not revealed. (Clients may wish to parse just once an expression which may be evaluated often). In support of which, the following two functions partition the work of Dbg_EvalExpr(). */#define Dbg_exfl_heap 1 /* allocate Expr on the heap (FreeExpr must then be called to discard it). Otherwise, it goes in a place overwritten by the next call to ParseExpr or EvalExpr */#define Dbg_exfl_needassign 2#define Dbg_exfl_lowlevel 4int Dbg_SetInputRadix(Dbg_MCState *state, int radix);char *Dbg_SetDefaultIntFormat(Dbg_MCState *state, char *format);Dbg_Error Dbg_ParseExpr( Dbg_MCState *state, Dbg_Environment const *env, char *string, char **end, Dbg_Expr **res, int flags);/* Just parse the argument string, returning a pointer to a parsed expression and a pointer to the first non-white space character in the input string which is not part of the parsed expression. (If macro expansion has taken place, the returned pointer will not be into the argument string at all, rather into the expanded version of it). */Dbg_Error Dbg_ParseExprCheckEnd( Dbg_MCState *state, Dbg_Environment const *env, char *string, Dbg_Expr **res, int flags);/* As Dbg_ParseExpr, but the parsed expression is required completely to fill the argument string (apart possibly for trailing whitespace), and an error is returned if it does not. */Dbg_Error Dbg_ParsedExprToValue( Dbg_MCState *state, const Dbg_Environment *env, Dbg_Expr *expr, Dbg_Value *v);Dbg_Error Dbg_ReadDecl( Dbg_MCState *state, Dbg_Environment const *env, char *string, Dbg_TypeSpec *p, char **varp, int flags);/* Read a variable declaration, returing a description of the type of the variable to p, and a pointer to its name to varp. */bool Dbg_IsCastToArrayType(Dbg_MCState *state, Dbg_Expr *expr);void Dbg_FreeExpr(Dbg_Expr *expr);Dbg_Error Dbg_CopyType(Dbg_TypeSpec *tdest, Dbg_TypeSpec const *tsource);Dbg_Error Dbg_FreeCopiedType(Dbg_TypeSpec *ts);Dbg_Error Dbg_TypeOfExpr(Dbg_MCState *state, Dbg_Expr *tree, Dbg_TypeSpec *restype);Dbg_Error Dbg_ExprToVar(const Dbg_Expr *expr, Dbg_DeclSpec *var, Dbg_Environment *env);Dbg_Error Dbg_Assign(Dbg_MCState *state, const Dbg_Value *lv, const Dbg_Value *rv);typedef enum Dbg_TypeSort { ts_simple, ts_union, ts_struct, ts_array} Dbg_TypeSort;Dbg_TypeSort Dbg_TypeSortOfValue(Dbg_MCState *state, const Dbg_Value *val, int *fieldcount);Dbg_Error Dbg_TypeToChars(const Dbg_TypeSpec *var, Dbg_BufDesc *buf);Dbg_Error Dbg_TypeSize(Dbg_MCState *state, const Dbg_TypeSpec *type, unsigned32 *res);typedef int Dbg_ValToChars_cb(Dbg_MCState *state, Dbg_Value *subval, const char *fieldname, Dbg_BufDesc *buf, void *arg);Dbg_Error Dbg_ValToChars(Dbg_MCState *state, Dbg_Value *val, int base, Dbg_ValToChars_cb *cb, void *arg, const char *form, Dbg_BufDesc *buf);/* <base> is used for (any size) integer values. If <val> is of an array or structure type, <cb> is called for each element, with <arg> as its last parameter, and <subbuf> describing the space remaining in <buf>. If <cb> returns 0, conversion ceases. */Dbg_Error Dbg_NthElement( Dbg_MCState *state, const Dbg_Value *val, unsigned32 n, char **fieldname, Dbg_Value *subval);typedef Dbg_Error Dbg_HistoryProc(void *, int, Dbg_Value *);Dbg_Error Dbg_RegisterHistoryProc(Dbg_MCState *state, Dbg_HistoryProc *p, void *arg);typedef enum { ls_cpu, ls_store, ls_copro, ls_local, ls_filtered} Dbg_LocSort;typedef struct { Dbg_LocSort sort; union { struct { ARMaddress addr, size; } store; struct { int modemask; int r; } cpu; struct { int no; int r; } cp; void *localp; Dbg_AccessFnRec f; } loc;} Dbg_Loc;typedef Dbg_Error Dbg_ObjectWriteProc(Dbg_MCState *state, Dbg_Loc const *loc);Dbg_Error Dbg_OnObjectWrite(Dbg_MCState *state, Dbg_ObjectWriteProc *p);/* Register function to be called back whenever the toolbox has written to any * object accessible by the debuggee (or to local variables belonging to a * toolbox client). The write has already been done. * (To allow multiple toolbox clients to coexist). */Dbg_Error Dbg_ObjectWritten(Dbg_MCState *state, Dbg_Loc const *loc);/*--------------------------------------------------------------------------*//* Control of target program execution. Currently, only synchronous operation is provided. Execution could possibly be asynchronous where the target is a seperate processor, but is necessarily synchronous if the target is Armulator. Unfortunately, this may require modification to the RDI implementation if multitasking is required but the the host system provides it only cooperatively, or if there is no system-provided way to generate SIGINT. */Dbg_Error Dbg_SetCommandline(Dbg_MCState *state, const char *args);/* Set the argument string to the concatenation of the name of the most recently loaded image and args. */typedef enum Dbg_ProgramState { ps_notstarted, /* Normal ways of stopping */ ps_atbreak, ps_atwatch, ps_stepdone, ps_interrupted, ps_stopped, /* abnormal (but unsurprising) ways of stopping */ ps_lostwatch, ps_branchthrough0, ps_undef, ps_caughtswi, ps_prefetch, ps_abort, ps_addrexcept, ps_caughtirq, ps_caughtfiq, ps_error, /* only as a return value from Call() */ ps_callfailed, ps_callreturned, /* internal inconsistencies */ ps_broken, /* target has "broken" */ ps_unknownbreak, ps_unknown} Dbg_ProgramState;int Dbg_IsCallLink(Dbg_MCState *state, ARMaddress pc);typedef struct { Dbg_FPRegVal fpres; ARMword intres;} Dbg_CallResults;Dbg_CallResults *Dbg_GetCallResults(Dbg_MCState *state);#define Dbg_S_STATEMENTS 0#define Dbg_S_INSTRUCTIONS 1#define Dbg_S_STEPINTOPROCS 2Dbg_Error Dbg_Step(Dbg_MCState *state, int32 stepcount, int stepby, Dbg_ProgramState *status);/* <stepby> is a combination of the Dbg_S_... values above */Dbg_Error Dbg_StepOut(Dbg_MCState *state, Dbg_ProgramState *status);bool Dbg_CanGo(Dbg_MCState *state);bool Dbg_IsExecuting(Dbg_MCState *state);Dbg_Error Dbg_Go(Dbg_MCState *state, Dbg_ProgramState *status);Dbg_Error Dbg_Stop(Dbg_MCState *state);/* Asynchronous Stop request, for call from SIGINT handler. On return to the caller, the call of Dbg_Go, Dbg_Step or Dbg_Call which started execution should return ps_interrupted. */typedef void Dbg_ExecuteProc(Dbg_MCState *state, Dbg_ProgramState status);Dbg_Error Dbg_OnExecute(Dbg_MCState *, Dbg_ExecuteProc *);/* Register function to be called back whenever execution stops. * (To allow multiple toolbox clients to coexist). */Dbg_Error Dbg_SetReturn(Dbg_MCState *state, const Dbg_Environment *context, const Dbg_Value *value);/* Prepare continuation by returning <value> from the function activation described by <context>. (Dbg_Go() or Dbg_Step() actually perform the continuation). */Dbg_Error Dbg_SetExecution(Dbg_MCState *state, Dbg_Environment *context);/* Set the pc in a high-level fashion */Dbg_Error Dbg_ProgramStateToChars(Dbg_MCState *state, Dbg_ProgramState event, Dbg_BufDesc *buf);/* This is guaranteed to give a completely accurate description of <event> if this was the value returned by the most recent call of Dbg_Go, Dbg_Step, or Dbg_Call. *//*--------------------------------------------------------------------------*/Dbg_Error Dbg_CurrentEnvironment(Dbg_MCState *state, Dbg_Environment *context);Dbg_Error Dbg_PrevFrame(Dbg_MCState *state, Dbg_Environment *context);/* towards the base of the stack */Dbg_Error Dbg_NextFrame(Dbg_MCState *state, Dbg_Environment *context);/* away from the base of the stack */typedef struct Dbg_AnyPos { enum { pos_source, pos_ll, pos_none } postype; ARMaddress pc; union { Dbg_ProcPos source; Dbg_LLPos ll; ARMaddress none; } pos;} Dbg_AnyPos;Dbg_Error Dbg_EnvironmentToPos(Dbg_MCState *state, const Dbg_Environment *context, Dbg_AnyPos *pos);/* <pos> is set to a Dbg_ProcPos if these is one corresponding to <context> else a Dbg_LLPos if there is one. *//*--------------------------------------------------------------------------*//* Source file management. Pretty vestigial. Handles source path (per loaded image), and translates from line-number (as given in debugger tables) to character position (as required to access files) */Dbg_Error Dbg_ClearPaths(Dbg_MCState *state, Dbg_SymTable *st);Dbg_Error Dbg_AddPath(Dbg_MCState *state, Dbg_SymTable *st, const char *path);Dbg_Error Dbg_DeletePath(Dbg_MCState *state, Dbg_SymTable *st, const char *path);typedef enum { Dbg_PathsCleared, Dbg_PathAdded, Dbg_PathDeleted} Dbg_PathAlteration;typedef void Dbg_PathAlteredProc( Dbg_MCState *state, Dbg_SymTable *st, char const *path, Dbg_PathAlteration sort);Dbg_Error Dbg_OnPathAlteration(Dbg_MCState *state, Dbg_PathAlteredProc *p);/* Register function to be called back whenever one of the source path * modification functions above is called. (To allow multiple toolbox * clients to coexist). */typedef struct Dbg_FileRec Dbg_FileRec;typedef struct { unsigned32 linecount; Dbg_FileRec *handle; char *fullname;} Dbg_FileDetails;Dbg_Error Dbg_GetFileDetails( Dbg_MCState *state, const Dbg_File *fname, Dbg_FileDetails *res);Dbg_Error Dbg_FinishedWithFile(Dbg_MCState *state, Dbg_FileRec *handle);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -