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

📄 armdbg.h

📁 这个是LINUX下的GDB调度工具的源码
💻 H
📖 第 1 页 / 共 4 页
字号:
Dbg_Error Dbg_GetFileDetails_fr(    Dbg_MCState *state, Dbg_FileRec *handle, Dbg_FileDetails *res);/* Refresh details about the file associated with <handle> (in particular, * its linecount). */Dbg_Error Dbg_FileLineLength(    Dbg_MCState *state, Dbg_FileRec *handle, int32 lineno, int32 *len);/* Return to <len> the length of line <lineno> of the file associated with * <handle> (without necessarily reading from the file). */Dbg_Error Dbg_GetFileLine_fr(    Dbg_MCState *state, Dbg_FileRec *handle, int32 lineno, Dbg_BufDesc *buf);/* Return to <buf> the contents of line <lineno> of the file associated with * <handle> (including its terminating newline). */Dbg_Error Dbg_StartFileAccess(Dbg_MCState *state, Dbg_FileRec *handle);Dbg_Error Dbg_EndFileAccess(Dbg_MCState *state, Dbg_FileRec *handle);/* These two calls bracket a sequence of calls to GetFileLine. Between the * calls, the toolbox is permitted to retain state allowing more rapid * access to text on the file associated with <handle>. */Dbg_Error Dbg_ControlSourceFileAccess(    Dbg_MCState *state, uint32 cachesize, bool closefiles);/* Control details of how the toolbox manages source files. *   If <cachesize> is non-zero, the text from the most recently accessed *     source files (of total size not to exceed <cachesize>) is saved in *     store on first access to the file; subsequent access to the text of *     the file uses this copy. *   If <closefiles> is true, no stream is left attached to uncached source *     files after Dbg_EndFileAccess has been closed. Otherwise, the toolbox *     may retain such streams, in order to improve access. *//*--------------------------------------------------------------------------*//* disassembly *//* ? More exact control is wanted here, but that requires a more complicated ? disass callback interface. */typedef const char *Dbg_SWI_Decode(Dbg_MCState *state, ARMword swino);Dbg_Error Dbg_InstructionAt(Dbg_MCState *state, ARMaddress addr,                    int isize, ARMhword *inst, Dbg_SymTable *st,                    Dbg_SWI_Decode *swi_name, Dbg_BufDesc *buf, int *length);/* <isize> describes the form of disassembly wanted: 2 for 16-bit, 4 for 32-bit, * 0 for 16- or 32-bit depending whether addr addresses 16- or 32-bit code. * <inst> is a pointer to a pair of halfwords *in target byte order* * Possibly only the first halfword will be consumed: the number of bytes used * is returned via <length>. *//*--------------------------------------------------------------------------*/int Dbg_RDIOpen(Dbg_MCState *state, unsigned type);int Dbg_RDIInfo(Dbg_MCState *state, unsigned type, ARMword *arg1, ARMword *arg2);/*--------------------------------------------------------------------------*/typedef enum {    Dbg_Point_Toolbox,    Dbg_Point_RDI_Unknown,    Dbg_Point_RDI_SW,    Dbg_Point_RDI_HW} Dbg_PointType;/* breakpoint management   Associated with a breakpoint there may be any of     a count     an expression     a function   the breakpoint is activated if        the expression evaluates to a non-zero value (or fails to evaluate).     && decrementing the count reaches zero (the count is then reset to its        initial value).     && the function, called with the breakpoint address as argument, returns        a non-zero value.?  (The order here may be open to debate.  Note that the first two are in    the opposite order in armsd, but I think this order more rational) */typedef enum Dbg_BreakPosType {    bt_procpos,    bt_procexit,    bt_address} Dbg_BreakPosType;typedef union {      Dbg_ProcPos procpos;      Dbg_ProcDesc procexit;      ARMaddress address;} Dbg_BreakPosPos;typedef struct Dbg_BreakPos {    Dbg_BreakPosType sort;    Dbg_BreakPosPos loc;} Dbg_BreakPos;typedef int Dbg_BPProc(Dbg_MCState *state, void *BPArg, Dbg_BreakPos *where);typedef struct Dbg_BreakStatus {    int index;    int initcount, countnow;    Dbg_BreakPos where;    char *expr;    Dbg_BPProc *p; void *p_arg;    int incomplete;    Dbg_PointType type;    ARMword hwresource;} Dbg_BreakStatus;Dbg_Error Dbg_StringToBreakPos(    Dbg_MCState *state, Dbg_Environment *env, char const *str, size_t len,    Dbg_BreakPos *bpos, char *b);Dbg_Error Dbg_SetBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where,                    int count,                    const char *expr,                    Dbg_BPProc *p, void *arg);Dbg_Error Dbg_SetBreakPoint16(Dbg_MCState *state, Dbg_BreakPos *where,                    int count,                    const char *expr,                    Dbg_BPProc *p, void *arg);Dbg_Error Dbg_SetBreakPointNaturalSize(Dbg_MCState *state, Dbg_BreakPos *where,                    int count,                    const char *expr,                    Dbg_BPProc *p, void *arg);/* Setting a breakpoint at the same address as a previous breakpoint   completely removes the previous one. */Dbg_Error Dbg_DeleteBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where);Dbg_Error Dbg_SuspendBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where);/* Temporarily remove the break point (until Reinstated) but leave intact   its associated expr, the value its count has reached, etc.?  The debugger toolbox itself wants this, but I'm not sure what use a client   could have for it.  Ditto Reinstate... */Dbg_Error Dbg_ReinstateBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where);/* Undo the effect of Dbg_SuspendBreakPoint */Dbg_Error Dbg_DeleteAllBreakPoints(Dbg_MCState *state);Dbg_Error Dbg_SuspendAllBreakPoints(Dbg_MCState *state);Dbg_Error Dbg_ReinstateAllBreakPoints(Dbg_MCState *state);typedef Dbg_Error Dbg_BPEnumProc(Dbg_MCState *state, Dbg_BreakStatus *status, void *arg);Dbg_Error Dbg_EnumerateBreakPoints(Dbg_MCState *state, Dbg_BPEnumProc *p, void *arg);Dbg_Error Dbg_BreakPointStatus(Dbg_MCState *state,                       const Dbg_BreakPos *where, Dbg_BreakStatus *status);typedef void Dbg_BreakAlteredProc(Dbg_MCState *state, ARMaddress addr, bool set);Dbg_Error Dbg_OnBreak(Dbg_MCState *state, Dbg_BreakAlteredProc *p);/* Register function to be called back whenever a breakpoint is set or * cleared. (To allow multiple toolbox clients to coexist). */bool Dbg_StoppedAtBreakPoint(Dbg_MCState *state, const Dbg_BreakPos *where);/* Called after execution which resulted in ps_atbreak, to find out whether   the specified breakpoint was hit (could be >1, eg. exit break and another   high-level breakpoint at the same position).   Returns NO if specified breakpoint not found, or execution didn't stop   with ps_atbreak status. *//*--------------------------------------------------------------------------*/typedef struct {  Dbg_Value val;  char *name;} Dbg_WatchPos;typedef int Dbg_WPProc(Dbg_MCState *state, void *WPArg, Dbg_WatchPos *where);typedef struct Dbg_WPStatus {    int index;    int initcount, countnow;    Dbg_WatchPos what, target;    char *expr;    Dbg_WPProc *p; void *p_arg;    Dbg_PointType type;    ARMword hwresource;    int skip;} Dbg_WPStatus;Dbg_Error Dbg_SetWatchPoint(    Dbg_MCState *state, Dbg_Environment *context, char const *watchee,    char const *target,    int count,    char const *expr,    Dbg_WPProc *p, void *arg);/* Cause a watchpoint event if the value of <watchee> changes to the value of   <target> (or changes at all if <target> is NULL).  <watchee> should   evaluate either to an L-value (when the size of the object being watched is   determined by its type) or to an integer constant (when the word with this   address is watched). */Dbg_Error Dbg_DeleteWatchPoint(Dbg_MCState *state, Dbg_Environment *context, char const *watchee);Dbg_Error Dbg_SetWatchPoint_V(    Dbg_MCState *state,    char const *name, Dbg_Value const *val, char const *tname, Dbg_Value const *tval,    int count,    char const *expr,    Dbg_WPProc *p, void *arg);Dbg_Error Dbg_DeleteWatchPoint_V(Dbg_MCState *state, Dbg_Value const *val);Dbg_Error Dbg_DeleteAllWatchPoints(Dbg_MCState *state);typedef Dbg_Error Dbg_WPEnumProc(Dbg_MCState *state, Dbg_WPStatus const *watchee, void *arg);Dbg_Error Dbg_EnumerateWatchPoints(Dbg_MCState *state, Dbg_WPEnumProc *p, void *arg);Dbg_Error Dbg_WatchPointStatus(Dbg_MCState *state,                       Dbg_WatchPos const *where, Dbg_WPStatus *status);typedef void Dbg_WPRemovedProc(void *arg, Dbg_WPStatus const *wp);Dbg_Error Dbg_RegisterWPRemovalProc(Dbg_MCState *state, Dbg_WPRemovedProc *p, void *arg);/* When a watchpoint goes out of scope it is removed by the toolbox, and the   function registered here gets called back to adjust its view */typedef void Dbg_WatchAlteredProc(Dbg_MCState *state, Dbg_Value const *where, bool set);Dbg_Error Dbg_OnWatch(Dbg_MCState *state, Dbg_WatchAlteredProc *p);/* Register function to be called back whenever a watchpoint is set or * cleared. (To allow multiple toolbox clients to coexist). *//*--------------------------------------------------------------------------*/Dbg_Error Dbg_ProfileLoad(Dbg_MCState *state);Dbg_Error Dbg_ProfileStart(Dbg_MCState *state, ARMword interval);Dbg_Error Dbg_ProfileStop(Dbg_MCState *state);Dbg_Error Dbg_ProfileClear(Dbg_MCState *state);Dbg_Error Dbg_WriteProfile(Dbg_MCState *state, char const *filename,                           char const *toolid, char const *arg);/*--------------------------------------------------------------------------*/Dbg_Error Dbg_ConnectChannel_ToHost(Dbg_MCState *state, RDICCProc_ToHost *p, void *arg);Dbg_Error Dbg_ConnectChannel_FromHost(Dbg_MCState *state, RDICCProc_FromHost *p, void *arg);/*--------------------------------------------------------------------------*//* Configuration data management */Dbg_Error Dbg_LoadConfigData(Dbg_MCState *state, char const *filename);Dbg_Error Dbg_SelectConfig(    Dbg_MCState *state,    RDI_ConfigAspect aspect, char const *name, RDI_ConfigMatchType matchtype,    unsigned versionreq, unsigned *versionp);Dbg_Error Dbg_ParseConfigVersion(    char const *s, RDI_ConfigMatchType *matchp, unsigned *versionp);typedef Dbg_Error Dbg_ConfigEnumProc(Dbg_MCState *state, RDI_ConfigDesc const *desc, void *arg);Dbg_Error Dbg_EnumerateConfigs(Dbg_MCState *state, Dbg_ConfigEnumProc *p, void *arg);/*--------------------------------------------------------------------------*//* Angel OS support */Dbg_Error Dbg_CreateTask(Dbg_MCState **statep, Dbg_MCState *parent, bool inherit);/* This is called when a task is to be debugged which has not been debugged   before - ie. there is no existing Dbg_MCState for this task. It   initialises a new Dbg_MCState and returns a pointer to it.   <parent> is any valid previously-created MCCState. If <inherit> is TRUE,   the new MCState inherits certain features from it (eg. symbols).   Otherwise, only features which are the same across all tasks are inherited,   (eg. global breakpoints). */Dbg_Error Dbg_DeleteTask(Dbg_MCState *state);/* This is called when a task dies, and frees up everything which relates to that   task which is controlled by armdbg. */Dbg_Error Dbg_DetachTask(Dbg_MCState *state);Dbg_Error Dbg_AttachTask(Dbg_MCState *state);/* These are called to request a switch of the current task.  First   Dbg_DetachTask should be called with the state of the old task.   Dbg_DetachTask will ensure that any cached state held by armdbg for   the old task is immediately written out to the target.   After Dbg_DetachTask is called and before Dbg_AttachTask is called   the OS channel manager should tell the target that any future   requests from the debugger will be fore the new task.   If the new task does not have an armdbg state structure   already, then Dbg_CreateTask should be called to create one (see   above).  Then Dbg_AttachTask is called to tell armdbg to treat the   new armdbg state as the current task. */typedef Dbg_Error Dbg_TaskSwitchProc(void *arg, Dbg_MCState *newstate);Dbg_Error Dbg_OnTaskSwitch(Dbg_MCState *state, Dbg_TaskSwitchProc *fn, void *arg);/* The front end may register a callback which gets called by armdbg whenever   Dbg_AttachTask is called.  This callback tells the front end the new current   Dbg_MCState it should use to call armdbg.   [Note that this is only useful if there is one front end shared between all    tasks rather than one front end per task]   The value of <arg> passed to Dbg_OnTaskSwitch is passed to <fn>   when it is called. */typedef Dbg_Error Dbg_RestartProc(    void *arg, Dbg_MCState *curstate, Dbg_MCState **newstate);Dbg_Error Dbg_OnRestart(Dbg_MCState *state, Dbg_RestartProc *fn, void *arg);/* This is used by the OS channels layer to register a callback which   will be made by the debugger toolbox early in the process of resuming   execution.   This callback must determine which task will be resumed when the target   restarts execution.  If this is not already the current task then it must   call Dbg_DetachTask and Dbg_AttachTask as decribed above to switch to the   task about to be resumed and return the state for the new task in   <newstate>.   This will ensure that armdbg updates the correct task on execution as well   as ensuring that stepping over a breakpointed instruction on restarting   happens correctly.   The value of <arg> passed to Dbg_OnRestart is passed to <fn>   when it is called. */#ifdef __cplusplus}#endif#endif/* End of armdbg.h */

⌨️ 快捷键说明

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