3.9. DWARF Utilities
Enumerations
- enum CUDBGElfImageType
- CUDA ELF image type.
- enum CUDBGRegClass
- Physical register types.
Variables
- CUDBGResult ( *CUDBGAPI_st::disassemble )( uint32_t dev, uint64_t addr, uint32_t* instSize, char* buf, uint32_t sz )
- Disassemble instruction at instruction address.
- CUDBGResult ( *CUDBGAPI_st::getElfImageByHandle )( uint32_t dev, uint64_t handle, CUDBGElfImageType type, void* elfImage, uint64_t size )
- Get the relocated or non-relocated ELF image for the given handle on the given device.
- CUDBGResult ( *CUDBGAPI_st::getHostAddrFromDeviceAddr )( uint32_t dev, uint64_t device_addr, uint64_t* host_addr )
- Given a device virtual address, return a corresponding system memory virtual address.
- CUDBGResult ( *CUDBGAPI_st::getPhysicalRegister30 )( uint64_t pc, char* reg, uint32_t* buf, uint32_t sz, uint32_t* numPhysRegs, CUDBGRegClass* regClass )
- Get the physical register number(s) assigned to a virtual register name at a given PC, if it's live at that PC.
- CUDBGResult ( *CUDBGAPI_st::getPhysicalRegister40 )( uint32_t dev, uint32_t sm, uint32_t wp, uint64_t pc, char* reg, uint32_t* buf, uint32_t sz, uint32_t* numPhysRegs, CUDBGRegClass* regClass )
- Get the physical register number(s) assigned to a virtual register name at a given PC, if it's live at that PC.
- CUDBGResult ( *CUDBGAPI_st::isDeviceCodeAddress )( uintptr_t addr, bool* isDeviceAddress )
- Determine whether a virtual address resides within device code.
- CUDBGResult ( *CUDBGAPI_st::isDeviceCodeAddress55 )( uintptr_t addr, bool* isDeviceAddress )
- Determine whether a virtual address resides within device code.
- CUDBGResult ( *CUDBGAPI_st::lookupDeviceCodeSymbol )( char* symName, bool* symFound, uintptr_t* symAddr )
- Determines whether a symbol represents a function in device code and returns its virtual address.
Enumerations
- enum CUDBGElfImageType
-
Values
- CUDBG_ELF_IMAGE_TYPE_NONRELOCATED = 0
- Non-relocated ELF image.
- CUDBG_ELF_IMAGE_TYPE_RELOCATED = 1
- Relocated ELF image.
- enum CUDBGRegClass
-
Values
- REG_CLASS_INVALID = 0x000
- The physical register is invalid.
- REG_CLASS_REG_CC = 0x001
- The physical register is a condition code register. Unused.
- REG_CLASS_REG_PRED = 0x002
- The physical register is a predicate register. Unused.
- REG_CLASS_REG_ADDR = 0x003
- The physical register is an address register. Unused.
- REG_CLASS_REG_HALF = 0x004
- The physical register is a 16-bit register. Unused.
- REG_CLASS_REG_FULL = 0x005
- The physical register is a 32-bit register.
- REG_CLASS_MEM_LOCAL = 0x006
- The content of the physical register has been spilled to memory.
- REG_CLASS_LMEM_REG_OFFSET = 0x007
- The content of the physical register has been spilled to the local stack (ABI only).
- REG_CLASS_UREG_PRED = 0x009
- The physical register is a uniform predicate register.
- REG_CLASS_UREG_HALF = 0x00a
- The physical register is a 16-bit uniform register.
- REG_CLASS_UREG_FULL = 0x00b
- The physical register is a 32-bit uniform register.
Variables
- CUDBGResult ( *CUDBGAPI_st::disassemble )( uint32_t dev, uint64_t addr, uint32_t* instSize, char* buf, uint32_t sz )
-
Disassemble instruction at instruction address. This method does not guarantee any specific output format and its result should be treated as plain text.
Since CUDA 3.0.
Parameters
- dev
- - device index
- addr
- - instruction address
- instSize
- - instruction size (32 or 64 bits)
- buf
- - disassembled instruction buffer
- sz
- - disassembled instruction buffer size
Returns
CUDBG_SUCCESS, CUDBG_ERROR_UNKNOWN, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_ADDRESS, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::getElfImageByHandle )( uint32_t dev, uint64_t handle, CUDBGElfImageType type, void* elfImage, uint64_t size )
-
Get the relocated or non-relocated ELF image for the given handle on the given device. The handle is provided in the ELF Image Loaded notification event.
Since CUDA 6.0.
See also:
Parameters
- dev
- - device index
- handle
- - elf image handle
- type
- - type of the requested ELF image
- elfImage
- - pointer to the ELF image
- size
Returns
CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::getHostAddrFromDeviceAddr )( uint32_t dev, uint64_t device_addr, uint64_t* host_addr )
-
Given a device virtual address, return a corresponding system memory virtual address. Since CUDA 4.1.
See also:
Parameters
- dev
- - device index
- device_addr
- - device memory address
- host_addr
- - returned system memory address
Returns
CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_MEMORY_SEGMENT, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::getPhysicalRegister30 )( uint64_t pc, char* reg, uint32_t* buf, uint32_t sz, uint32_t* numPhysRegs, CUDBGRegClass* regClass )
-
Get the physical register number(s) assigned to a virtual register name at a given PC, if it's live at that PC. Since CUDA 3.0.
Note:DEPRECATED in CUDA 3.1: Do not use.
Parameters
- pc
- - Program counter
- reg
- - virtual register index
- buf
- - physical register name(s)
- sz
- - the physical register name buffer size
- numPhysRegs
- - number of physical register names returned
- regClass
- - the class of the physical registers
Returns
CUDBG_SUCCESS, CUDBG_ERROR_BUFFER_TOO_SMALL, CUDBG_ERROR_UNKNOWN_FUNCTION, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::getPhysicalRegister40 )( uint32_t dev, uint32_t sm, uint32_t wp, uint64_t pc, char* reg, uint32_t* buf, uint32_t sz, uint32_t* numPhysRegs, CUDBGRegClass* regClass )
-
Get the physical register number(s) assigned to a virtual register name at a given PC, if it's live at that PC. Instead, the PTX to SASS mappings can be read from the cubin directly.
Since CUDA 3.1.
Note:DEPRECATED in CUDA 4.1: Do not use.
Parameters
- dev
- - device index
- sm
- - SM index
- wp
- - warp index
- pc
- - Program counter
- reg
- - virtual register index
- buf
- - physical register name(s)
- sz
- - the physical register name buffer size
- numPhysRegs
- - number of physical register names returned
- regClass
- - the class of the physical registers
Returns
CUDBG_SUCCESS, CUDBG_ERROR_BUFFER_TOO_SMALL, CUDBG_ERROR_UNKNOWN_FUNCTION, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::isDeviceCodeAddress )( uintptr_t addr, bool* isDeviceAddress )
-
Determine whether a virtual address resides within device code. Since CUDA 3.0.
Parameters
- addr
- - virtual address
- isDeviceAddress
- - true if address resides within device code
Returns
CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::isDeviceCodeAddress55 )( uintptr_t addr, bool* isDeviceAddress )
-
Determine whether a virtual address resides within device code. Behaves exactly like isDeviceCodeAddress.
Since CUDA 3.0.
Note:DEPRECATED in CUDA 6.0: Use isDeviceCodeAddress instead.
See also:
Parameters
- addr
- - virtual address
- isDeviceAddress
- - true if address resides within device code
Returns
CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL
- CUDBGResult ( *CUDBGAPI_st::lookupDeviceCodeSymbol )( char* symName, bool* symFound, uintptr_t* symAddr )
-
Determines whether a symbol represents a function in device code and returns its virtual address. Since CUDA 3.0.
Parameters
- symName
- - symbol name
- symFound
- - set to true if the symbol is found
- symAddr
- - the symbol virtual address if found
Returns
CUDBG_SUCCESS, CUDBG_ERROR_UNKNOWN_FUNCTION, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL