📄 jtag_rdi.cpp
字号:
/*
* Function: RDI_CPreadProc
* Purpose: Read the register content from the specified coprocessor.
* The mask specifies which register(s) are to be transferred
* as 32-bit ARMwords. The mask has been extended to support
* more than 32 registers in RDI2.
*
* Each coprocessor will have its own register set defined in
* another header file. The actual registers transferred, and
* their size is dependent on the coprocessor specified.
*
* Params:
* Input: mh handle identifies processor
* Input: CPnum coprocessor number for this processor
* Input mask[] bits define which registers are to be transferred
* InOut: none
* Output: state[] destination array for register values
*
* Returns:
* OK: RDIError_NoError
* Error: error code
*/
int MyRDI_CPReadProc(RDI_ModuleHandle mh, unsigned CPnum, unsigned32 mask, ARMword *state)
{
OutputDebugString("MyRDI_CPReadProc");
return RDIError_UnimplementedMessage;
}
/*
* Function: RDI_CPwriteProc
* Purpose: Write the register content to the specified coprocessor.
* The mask specifies which register(s) are to be transferred
* as 32-bit ARMwords. The mask has been extended to support
* more than 32 registers in RDI2.
*
* Each coprocessor will have its own register set defined in
* another header file. The actual registers transferred, and
* their size is dependent on the coprocessor specified.
*
* Params:
* Input: mh handle identifies processor
* Input: CPnum coprocessor number for this processor
* Input mask[] bits define which registers are to be transferred
* Input: state[] source array of register values
* InOut: none
* Output: none
*
* Returns:
* OK: RDIError_NoError
* Error: error code
*/
int MyRDI_CPWriteProc(RDI_ModuleHandle mh, unsigned CPnum, unsigned32 mask, ARMword const *state)
{
OutputDebugString("MyRDI_CPWriteProc");
return RDIError_UnimplementedMessage;
}
/*
* Function: RDI_SetBreakProc
* Purpose: Set a breakpoint in the debuggee.
*
* Params:
* Input: mh handle identifies processor
* Input: address address of breakpoint
* Input: type one of RDIPoint_ types
*
* RDIPoint_EQ equal to address
* RDIPoint_GT greater than address
* RDIPoint_GE greater than or equal to address
* RDIPoint_LT less than address
* RDIPoint_LE less than or equal to address
* RDIPoint_IN in the range from address to (address+bound), incl
* RDIPoint_OUT not in the range from address to (address+bound),incl
* RDIPoint_MASK halt execution if (pc & bound) = address
* RDIPoint_16Bit if set breakpoint is on 16-bit (Thumb) instruction
* RDIPoint_Conditional if set breakpoint only occurs when the
* instructions condition is true.
*
* Input: bound upper address range
* Input: thread thread used by OS (set to RDI_NoHandle for global)
* InOut: none
* Output: *handle A handle to identify the breakpoint
*
* Returns:
* OK: RDIError_NoError
* OK: RDIError_NoMorePoints - successful,
* but no more points available
* Error: RDIError_CantSetPoint
*/
int MyRDI_SetBreakProc(RDI_ModuleHandle mh, ARMword address, unsigned type, ARMword bound, RDI_ThreadHandle thread, RDI_PointHandle *handle)
{
OutputDebugString("MyRDI_SetBreakProc");
return RDIError_CantSetPoint;
}
/*
* Function: RDI_ClearBreakProc
* Purpose: Clear a breakpoint in the debuggee.
*
* Params:
* Input: mh identifies processor
* Input: handle identifies breakpoint
* InOut: none
* Output: none
*
* Returns:
* OK: RDIError_NoError
* Error: RDIError_NoSuchPoint
*/
int MyRDI_ClearBreakProc(RDI_ModuleHandle mh, RDI_PointHandle handle)
{
OutputDebugString("MyRDI_ClearBreakProc");
return RDIError_NoSuchPoint;
}
/*
* Function: RDI_SetWatchProc
* Purpose: Set a watchpoint in the debuggee.
*
* Params:
* Input: mh handle identifies processor
* Input: address address of watchpoint
* Input: type one of RDIPoint_ types
*
* RDIPoint_EQ equal to address
* RDIPoint_GT greater than address
* RDIPoint_GE greater than or equal to address
* RDIPoint_LT less than address
* RDIPoint_LE less than or equal to address
* RDIPoint_IN in the range from address to (address+bound), inclus
* RDIPoint_OUT not in the range from address to (address+bound),incl
* RDIPoint_MASK halt execution if (pc & bound) = address
*
* Input: datatype one of RDIWatch_ data types
* Input: bound upper address range
* Input: thread thread used by OS (set to RDI_NoHandle for global)
* InOut: none
* Output: *handle A handle to identify the watchpoint
*
* Returns:
* OK: RDIError_NoError
* OK: RDIError_NoMorePoints - successful,
* but no more points available
* Error: RDIError_CantSetPoint
*/
int MyRDI_SetWatchProc(RDI_ModuleHandle mh, ARMword address, unsigned type, unsigned datatype, ARMword bound, RDI_ThreadHandle thread, RDI_PointHandle *handle)
{
OutputDebugString("MyRDI_SetWatchProc");
return RDIError_CantSetPoint;
}
/*
* Function: RDI_ClearWatchProc
* Purpose: Clear a watchpoint in the debuggee.
*
* Params:
* Input: mh identifies processor
* Input: handle identifies watchpoint
* InOut: none
* Output: none
*
* Returns:
* OK: RDIError_NoError
* Error: RDIError_NoSuchPoint
*/
int MyRDI_ClearWatchProc(RDI_ModuleHandle mh, RDI_PointHandle handle)
{
OutputDebugString("MyRDI_ClearWatchProc");
return RDIError_NoSuchPoint;
}
/*
* Function: RDI_ExecuteProc
* Purpose: Starts execution of the debuggee from the current state.
* The debuggee continues until a natural exit occurs.
* The reason for exit is returned.
*
* Params:
* Input: agent Identifies the debug agent.
* Input: stop_others
* TRUE => Only run the specified processor (*mh). All
* other processors remain halted
* FALSE =>Start the whole target running
*
* InOut: *mh
* In: (stop_others == TRUE):
* identifies a specific processor to execute
* (stop_others == FALSE):
* ignored
*
* Out: Handle of the processor that caused the exit.
* If no specific processor caused the exit, this is the
* handle of any valid processor.
*
* Output: *point if (return == RDIError_BreakpointReached)
* handle of breakpoint
* if (return == RDIError_WatchpointAccessed)
* handle of watchpoint
* else RDINoHandle
* In the current Demon debuggee the handles are not set.
* Here the debugger is required to fetch the pc to
* determine the point.
* (Demon condition is (pointReached && RDINoHandle))
*
* Returns:
* OK: RDIError_NoError
* OK: RDIError_BreakpointReached Breakpoint reached
* OK: RDIError_WatchpointAccessed Watch point accessed
* OK: RDIError_UserInterrupt User stop via RDISignal_Stop
*
* Vector Catches (see RDIVector_Catch Info call)
* OK: RDIError_BranchThrough0 Branch through zero
* OK: RDIError_UndefinedInstruction Undefined instruction
* OK: RDIError_SoftwareInterrupt Software interrupt
* OK: RDIError_PrefetchAbort Prefetch abort
* OK: RDIError_DataAbort Data abort
* OK: RDIError_AddressException Address exception
* OK: RDIError_IRQ Interrupt (IRQ)
* OK: RDIError_FIQ Fast Interrupt (FRQ)
* OK: RDIError_Error Error (see RDIErrorP)
*
* Error: RDIError_UnimplementedMessage under the following conditions
* if stop_others = TRUE and *mh = RDINoHandle
* or
* if stop_others = TRUE and stopping of individual
* processors is not supported on the target
* or
* if stop_others = TRUE and the particular configuration
* of running the specified processor and stopping others
* is not permitted, even though other 'stop_others'
* configurations are supported.
*/
int MyRDI_ExecuteProc(RDI_AgentHandle agent, RDI_ModuleHandle *mh, bool stop_others, RDI_PointHandle *handle)
{
OutputDebugString("MyRDI_ExecuteProc");
return RDIError_UnimplementedMessage;
}
/*
* Function: RDI_StepProc
* Purpose: Steps the debuggee from the current state.
* The debuggee continues until a natural exit occurs
* or the specified processor completes its next instruction.
* If a processor if not specified (RDINoHandle) then the exit
* shall be when any processor reaches its next instruction
* completion. The reason for exit is returned.
*
* Params:
* Input: agent Identifies the debug agent.
* Input: stop_others
* TRUE => Only run the specified processor (*mh). All
* other processors remain halted
* FALSE =>Start the whole target running
*
* InOut: *mh
* In: identifies a specific processor to step. In the absence
* of other exit conditions, the execution will halt when
* the specified processor completes a step.
*
* if (*mh == RDINoHandle), then in the absence of other
* exit conditions, the execution will halt when any
* processor completes a step.
*
* Out: Handle of the processor that caused the exit.
* If no specific processor caused the exit, this is the
* handle of any valid processor.
*
* Output: *point if (return == RDIError_BreakpointReached)
* handle of breakpoint
* if (return == RDIError_WatchpointAccessed)
* handle of watchpoint
* else RDINoHandle
* In the current Demon debuggee the handles are not set.
* Here the debugger is required to fetch the pc to
* determine the point.
* (Demon condition is (pointReached && RDINoHandle))
*
* Returns:
* OK: RDIError_NoError
* OK: RDIError_BreakpointReached Breakpoint reached
* OK: RDIError_WatchpointAccessed Watch point accessed
* OK: RDIError_UserInterrupt User stop via RDISignal_Stop
*
* Vector Catches (see RDIVector_Catch Info call)
* OK: RDIError_BranchThrough0 Branch through zero
* OK: RDIError_UndefinedInstruction Undefined instruction
* OK: RDIError_SoftwareInterrupt Software interrupt
* OK: RDIError_PrefetchAbort Prefetch abort
* OK: RDIError_DataAbort Data abort
* OK: RDIError_AddressException Address exception
* OK: RDIError_IRQ Interrupt (IRQ)
* OK: RDIError_FIQ Fast Interrupt (FRQ)
* OK: RDIError_Error Error (see RDIErrorP)
*
* Error: RDIError_UnimplementedMessage under the following conditions
* if stop_others = TRUE and *mh = RDINoHandle
* or
* if stop_others = TRUE and stopping of individual
* processors is not supported on the target
* or
* if stop_others = TRUE and the particular configuration
* of running the specified processor and stopping others
* is not permitted, even though other 'stop_others'
* configurations are supported.
*/
int MyRDI_StepProc(RDI_AgentHandle agent, RDI_ModuleHandle *mh, bool stop_others, unsigned ninstr, RDI_PointHandle *handle)
{
OutputDebugString("MyRDI_StepProc");
return RDIError_UnimplementedMessage;
}
/* The argument to rdi_info_proc is either an RDI_ModuleHandle (for the
* majority of calls) or an RDI_AgentHandle (for a small number of
* "Agent" calls). Which it is depends on the info code. Unless otherwise
* stated (above) all calls take a ModuleHandle.
*/
/*
* Function: RDI_InfoProc
* Purpose: Used to transfer miscellaneous information between the
* Debuger and the Debuggee. The parameters meanings change for
* each information type.
* Each type is defined in RDI_Info subcodes.
*
* Params:
* Input: mh handle identifies processor
* if RDINoHandle this is general target information
* (e.g. hadware configuration) ?? This looks wrong ??
* Input: type Information type code
*
* Use of arg parameters varies dependent on type code.
* See each individual definition below.
* InOut: arg1 parameter 1
* InOut: arg2 parameter 2
*
* Returns:
* OK: RDIError_NoError
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -