3.4. 断点

变量

CUDBGResult  ( *CUDBGAPI_st::getAdjustedCodeAddress )( uint32_t devId, uint64_t address, uint64_t* adjustedAddress, CUDBGAdjAddrAction adjAction )
The client must call this function before inserting a breakpoint, or when the previous or next code address is needed. Returns the adjusted code address for a given code address for a given device.
CUDBGResult  ( *CUDBGAPI_st::setBreakpoint )( uint32_t dev, uint64_t addr )
Sets a breakpoint at the given instruction address for the given device. Before setting a breakpoint, CUDBGAPI_st::getAdjustedCodeAddress should be called to get the adjusted breakpoint address.
CUDBGResult  ( *CUDBGAPI_st::setBreakpoint31 )( uint64_t addr )
Sets a breakpoint at the given instruction address.
CUDBGResult  ( *CUDBGAPI_st::unsetBreakpoint )( uint32_t dev, uint64_t addr )
Unsets a breakpoint at the given instruction address for the given device.
CUDBGResult  ( *CUDBGAPI_st::unsetBreakpoint31 )( uint64_t addr )
Unsets a breakpoint at the given instruction address.

变量

CUDBGResult ( *CUDBGAPI_st::getAdjustedCodeAddress )( uint32_t devId, uint64_t address, uint64_t* adjustedAddress, CUDBGAdjAddrAction adjAction )

客户端在插入断点或需要获取前一个/下一个代码地址时,必须调用此函数。该函数会返回针对指定设备调整后的给定代码地址。自CUDA 5.5版本起支持此功能。

另请参阅:

unsetBreakpoint

参数
devId
- the device index
address
adjustedAddress
- adjusted address
adjAction
- whether the adjusted next, previous or current address is needed
返回

CUDBG_SUCCESS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_ADDRESS, CUDBG_ERROR_INVALID_DEVICE

CUDBGResult ( *CUDBGAPI_st::setBreakpoint )( uint32_t dev, uint64_t addr )

在指定设备的给定指令地址处设置断点。在设置断点前,应先调用CUDBGAPI_st::getAdjustedCodeAddress获取调整后的断点地址。自CUDA 3.2版本起支持此功能。

另请参阅:

unsetBreakpoint

参数
dev
- the device index
addr
- instruction address
返回

CUDBG_SUCCESS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_ADDRESS, CUDBG_ERROR_INVALID_DEVICE

CUDBGResult ( *CUDBGAPI_st::setBreakpoint31 )( uint64_t addr )

在给定的指令地址设置断点。自 CUDA 3.0 起支持。

另请参阅:

unsetBreakpoint31

参数
addr
- instruction address
返回

CUDBG_SUCCESS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_ADDRESS

CUDBGResult ( *CUDBGAPI_st::unsetBreakpoint )( uint32_t dev, uint64_t addr )

在指定设备的给定指令地址处取消断点设置。自CUDA 3.2起支持。

另请参阅:

setBreakpoint

参数
dev
- the device index
addr
- instruction address
返回

CUDBG_SUCCESS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_ADDRESS, CUDBG_ERROR_INVALID_DEVICE

CUDBGResult ( *CUDBGAPI_st::unsetBreakpoint31 )( uint64_t addr )

在给定的指令地址取消断点设置。自 CUDA 3.0 起支持。

另请参阅:

setBreakpoint31

参数
addr
- instruction address
返回

CUDBG_SUCCESS, CUDBG_ERROR_UNINITIALIZED