📄 bkenddoc.html
字号:
WDB_CTX_ANY = 2, /* any context (not implemented) */ WDB_CTX_TASK = 3, /* specific task or processes */ WDB_CTX_ANY_TASK = 4, /* any task */ WDB_CTX_ISR = 5, /* specific ISR (not implemented) */ WDB_CTX_ANY_ISR = 6 /* any ISR (not implemented) */ } WDB_CTX_TYPE;</pre><p>For context start eventpoints (<b>WDB_EVT_CTX_START</b>), the <b>contextId</b> fieldand <b>contextType</b> fields are not used. This eventpoint always appliesto all task mode contexts created.<p>The <b>action</b> field is a <b>WDB_ACTION</b> structure describing what to dowhen the event occurs.<p><pre>typedef struct wdb_action /* a specific action */ { WDB_ACTION_TYPE actionType; UINT32 actionArg; TGT_ADDR_T callRtn; TGT_INT_T callArg; } WDB_ACTION;</pre><p>The <b>actionType</b> gives a list of actions to perform when the event pointis triggered. These actions are bitwise or'ed together:<dl><dt><b>WDB_ACTION_STOP</b><dd>stop the context that triggered the event point<p><dt><b>WDB_ACTION_NOTIFY</b><dd>notify the target server of the event<p><dt><b>WDB_ACTION_CALL</b><dd> call the <b>action.callRtn</b> routine with parameter <b>action.callArg</b> </dl><p>For classical breakpoints, <b>actionType</b> is<b>WDB_ACTION_STOP</b> | <b>WDB_ACTION_NOTIFY</b>. However this syntax provides muchmore flexibility for handling events.<p>Context-specific event points should be automatically deleted whenthe context exits. Otherwise event points are persistent until<b><i><a href="./bkendDoc.html#bkendEventpointDelete">bkendEventpointDelete</a></i>( )</b> is called to delete them.Tasking breakpoints (and hardware breakpoints) must be disabled ifthe debug mode is changed to external mode using <b><i><a href="./bkendDoc.html#bkendModeSet">bkendModeSet</a></i>( )</b> andreenabled if the mode is switched back again. External mode breakpoints(and hardware breakpoints) are handled similarly when switching totask mode.<p>When the event occurs and the <b>WDB_ACTION_NOTIFY</b> bit is set, target servernotification occurs as described in the <i>API Programmer's Guide: Target Server Back End </i>.After notification, the target server calls <b><i><a href="./bkendDoc.html#bkendEventGet">bkendEventGet</a></i>( )</b> to get the event. All exception events are reported by the back end, even if an event point has not been set for exception events.<p></blockquote><h4>CAVEATS</h4><blockquote><p>For breakpoint events (<b>WDB_EVT_BP</b>) and hardware breakpoint events(<b>WDB_EVT_HW_BP</b>), if <b>actionType</b> is <b>WDB_ACTION_STOP</b> or 0, interpret itto mean <b>WDB_ACTION_STOP</b> | <b>WDB_ACTION_NOTIFY</b>.For context exit events (<b>WDB_EVT_CTX_EXIT</b>), if <b>actionType</b> is 0,interpret it to mean <b>WDB_ACTION_NOTIFY</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success or one of the following error codes:<dl><dt><b>WDB_ERR_COMMUNICATION</b><dd>The connection to the target has died.<p><dt><b>WDB_ERR_INVALID_EVENT</b><dd>Unsupported <b>evtType</b>.<p><dt><b>WDB_ERR_EVENTPOINT_TABLE_FULL</b><dd>The event point table is full.<p><dt><b>WDB_ERR_HW_REGS_EXHAUSTED</b><dd>The CPU hardware breakpoint registers are exhausted (<b>WDB_EVT_HW_BP</b> `evtType`).<p><dt><b>WDB_ERR_INVALID_HW_BP</b><dd>Invalide hardware breakpoint type.<p><dt><b>WDB_ERR_INVALID_CONTEXT</b><dd> Invalid context<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, * .I "API Programmer's Guide: Target Server Back End"<hr><a name="bkendEventpointDelete"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendEventpointDelete</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendEventpointDelete</i>( )</strong> - delete an event point</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT32 bkendEventpointDelete ( WDB_EVTPT_DEL_DESC * pWdbEventpoint /* event point to delete */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function deletes an event point on the target. The event point todelete is specified by a <b>WDB_EVTPT_DEL_DESC</b> structure pointed to by<i>pWdbEventpoint</i>.<p><pre>typedef struct wdb_evtpt_del_desc /* how to delete an eventpoint */ { WDB_EVT_TYPE evtType; /* type of event */ TGT_ADDR_T evtptId; /* eventpoint ID */ } WDB_EVTPT_DEL_DESC;</pre><p>The <b>evtType</b> field specifies the type of event point to delete. It isthe same as the value passed to <b><i><a href="./bkendDoc.html#bkendEventpointAdd">bkendEventpointAdd</a></i>( )</b>. The <b>evtptId</b> fieldis the event point ID returned by <b><i><a href="./bkendDoc.html#bkendEventpointAdd">bkendEventpointAdd</a></i>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success or one of the following error codes:<dl><dt><b>WDB_ERR_COMMUNICATION</b><dd>The connection to the target has died.<p><dt><b>WDB_ERR_INVALID_EVENT</b><dd>Unsupported <b>evtType</b>.<p><dt><b>WDB_ERR_INVALID_EVENTPOINT</b><dd> Invalid <b>evtptId</b>.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, * .I "API Programmer's Guide: Target Server Back End"<hr><a name="bkendEventGet"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendEventGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendEventGet</i>( )</strong> - get an event from the target</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT32 bkendEventGet ( WDB_EVT_DATA * pWdbEvtData /* event description */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is called by the target server to get an event from thetarget. It is called only after the back end has notified the targetserver that events are pending on the target. (See the <i>API Programmer's Guide: Target Server Back End </i>for details on the event notification mechanism.) This routine fills in a<b>WDB_EVT_DATA</b> structure pointed to by <i>pWdbEvtData</i>.<p><pre>typedef struct wdb_evt_data /* reply to a WDB_EVENT_GET */ { WDB_EVT_TYPE evtType; /* event type detected */ union /* eventType specific info */ { WDB_MEM_XFER vioWriteInfo; /* vio write event data */ WDB_CALL_RET_INFO callRetInfo; /* call return event data */ WDB_EVT_INFO evtInfo; /* any other event info */ } eventInfo; } WDB_EVT_DATA;</pre><p>The <b>evtType</b> field depends on the event. If no new events have occurredon the target, this field must be set to <b>WDB_EVT_NONE</b>.The rest of this structure contains an event information structure whichdepends on the <b>evtType</b>:<p><table><tr valign=top><th align=left>Event Type </th><th align=left> Event Data</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left><b>WDB_EVT_CTX_EXIT</b> </td><td align=left> <b>WDB_CTX_EXIT_INFO</b></tr><tr valign=top><td align=left><b>WDB_EVT_CTX_START</b> </td><td align=left> <b>WDB_CTX_START_INFO</b></tr><tr valign=top><td align=left><b>WDB_EVT_BP</b> </td><td align=left> <b>WDB_BP_INFO</b></tr><tr valign=top><td align=left><b>WDB_EVT_WP</b> </td><td align=left> <b>WDB_BP_INFO</b></tr><tr valign=top><td align=left><b>WDB_EVT_EXC</b> </td><td align=left> <b>WDB_EXC_INFO</b></tr><tr valign=top><td align=left><b>WDB_EVT_VIO_WRITE</b> </td><td align=left> <b>WDB_MEM_XFER</b></tr><tr valign=top><td align=left><b>WDB_EVT_CALL_RET</b> </td><td align=left> <b>WDB_CALL_RET_INFO</b></tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>OK on success or the following error code:<dl><dt><b>WDB_ERR_COMMUNICATION</b><dd> The connection to the target has died.<p></dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, * .I "API Programmer's Guide: Target Server Back End"<hr><a name="bkendEvtPending"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendEvtPending</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendEvtPending</i>( )</strong> - check if an event is pending</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL bkendEvtPending (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is called by the target server to detect if a target event is pending.<p></blockquote><h4>RETURNS</h4><blockquote><p>TRUE if a target event is pending, otherwise FALSE.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, <i>API Programmer's Guide: Target Server Back End </i><hr><a name="bkendFlagsGet"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendFlagsGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendFlagsGet</i>( )</strong> - Get the supported flags for this backend</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>FLAG_DESC * bkendFlagsGet (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is called by the target server when it wants to get the flagssupported by the currently attached backend. The backend should give a list(NULL terminated) of <b>FLAG_DESC</b> structure.<pre>typedef struct flag_desc { char * flagName; /* verbose flag name */ char * flagTerseName; /* abbreviated name of flag (or NULL) */ PARSE_RTN parseRoutine; /* flag processing routine */ void * outputPtr; /* where to store the output result */ char * flagHelp; /* flag help string */ } FLAG_DESC;</pre><p>each element represents an option supported by the backend. For each element,you must precise :<dl><dt><b>flagName</b><dd>the flag itself (e.g. -foo)<p><dt><b>flagTerseName</b><dd>for an abbreviated version of this flag (NULL if none).<p><dt><b>parseRoutine</b><dd>the routine which will be called by the target server if this flag is set.<p><dt><b>outputPtr</b><dd>an argument which will be given to the routine (a value we want to be set ifthe flag is found on the command line). For example, an integer address forthe flagInt routine. If the flag is found on the command line, this integerwill be set with the argument given to the flag (e.g. -foo 10)<p><dt><b>flagHelp</b><dd> a string which will be displayed on help demand. </dl><p>A detailed description of back-end argument handling can be found in the<i>API Programmer's Guide: Target Server Back End </i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>a pointer on a <b>FLAG_DESC</b> array (last element is NULL) or NULL if noargument are supported by this backend.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, <i>API Programmer's Guide: Target Server Back End </i><hr><a name="bkendFreeResultArgs"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendFreeResultArgs</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendFreeResultArgs</i>( )</strong> - free the memory used by the returned structure</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL bkendFreeResultArgs (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function frees any memory allocated by the last back-endfunction that was called. Ideally, none of the back-end functionsallocate memory, in which case this routine becomes a no-op.<p></blockquote><h4>RETURNS</h4><blockquote><p>TRUE on success, FALSE if an error occurred.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendDoc.html#top">bkendDoc</a></b>, <i>API Programmer's Guide: Target Server Back End </i><hr><a name="bkendFuncCall"></a><p align=right><a href="rtnIndex.html"><i>Target Server Back End Interface : Routines</i></a></p></blockquote><h1><i>bkendFuncCall</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendFuncCall</i>( )</strong> - call a target function asynchronously</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>UINT32 bkendFuncCall ( WDB_CTX_CREATE_DESC * pWdbContext, /* function call parameters */ UINT32 * pCid /* context ID */ )</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -