AMD_DBGAPI  0.36.0
Data Structures | Macros | Enumerations | Functions
Registers

Operations related to AMD GPU register access. More...

Data Structures

struct  amd_dbgapi_register_class_id_t
 Opaque register class handle. More...
 
struct  amd_dbgapi_register_id_t
 Opaque register handle. More...
 

Macros

#define AMD_DBGAPI_REGISTER_CLASS_NONE   (amd_dbgapi_register_class_id_t{ 0 })
 The NULL register class handle. More...
 
#define AMD_DBGAPI_REGISTER_NONE   (amd_dbgapi_register_id_t{ 0 })
 The NULL register handle. More...
 

Enumerations

enum  amd_dbgapi_register_class_info_t { AMD_DBGAPI_REGISTER_CLASS_INFO_NAME = 1 }
 Register class queries that are supported by amd_dbgapi_architecture_register_class_get_info. More...
 
enum  amd_dbgapi_register_info_t { AMD_DBGAPI_REGISTER_INFO_NAME = 1, AMD_DBGAPI_REGISTER_INFO_SIZE = 2, AMD_DBGAPI_REGISTER_INFO_TYPE = 3 }
 Register queries that are supported by amd_dbgapi_architecture_register_get_info and amd_dbgapi_wave_register_get_info. More...
 
enum  amd_dbgapi_register_class_state_t { AMD_DBGAPI_REGISTER_CLASS_STATE_NOT_MEMBER = 0, AMD_DBGAPI_REGISTER_CLASS_STATE_MEMBER = 1 }
 Indication of whether a register is a member of a register class. More...
 

Functions

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_class_get_info (amd_dbgapi_architecture_id_t architecture_id, amd_dbgapi_register_class_id_t register_class_id, amd_dbgapi_register_class_info_t query, size_t value_size, void *value) AMD_DBGAPI_VERSION_0_24
 Query information about a register class of an architecture. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_class_list (amd_dbgapi_architecture_id_t architecture_id, size_t *register_class_count, amd_dbgapi_register_class_id_t **register_classes) AMD_DBGAPI_VERSION_0_24
 Report the list of register classes supported by the architecture. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_get_info (amd_dbgapi_architecture_id_t architecture_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_register_info_t query, size_t value_size, void *value) AMD_DBGAPI_VERSION_0_24
 Query information about a register of an architecture. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_wave_register_get_info (amd_dbgapi_process_id_t process_id, amd_dbgapi_wave_id_t wave_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_register_info_t query, size_t value_size, void *value) AMD_DBGAPI_VERSION_0_24
 Query information about a register of a wave. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_list (amd_dbgapi_architecture_id_t architecture_id, size_t *register_count, amd_dbgapi_register_id_t **registers) AMD_DBGAPI_VERSION_0_24
 Report the list of registers supported by the architecture. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_wave_register_list (amd_dbgapi_process_id_t process_id, amd_dbgapi_wave_id_t wave_id, size_t *register_count, amd_dbgapi_register_id_t **registers) AMD_DBGAPI_VERSION_0_24
 Report the list of registers supported by a wave. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_dwarf_register_to_register (amd_dbgapi_architecture_id_t architecture_id, uint64_t dwarf_register, amd_dbgapi_register_id_t *register_id) AMD_DBGAPI_VERSION_0_24
 Return a register handle from an AMD GPU DWARF register number. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_register_is_in_register_class (amd_dbgapi_architecture_id_t architecture_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_register_class_id_t register_class_id, amd_dbgapi_register_class_state_t *register_class_state) AMD_DBGAPI_VERSION_0_24
 Determine if a register is a member of a register class. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_read_register (amd_dbgapi_process_id_t process_id, amd_dbgapi_wave_id_t wave_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_size_t offset, amd_dbgapi_size_t value_size, void *value) AMD_DBGAPI_VERSION_0_24
 Read a register. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_write_register (amd_dbgapi_process_id_t process_id, amd_dbgapi_wave_id_t wave_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_size_t offset, amd_dbgapi_size_t value_size, const void *value) AMD_DBGAPI_VERSION_0_24
 Write a register. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_prefetch_register (amd_dbgapi_process_id_t process_id, amd_dbgapi_wave_id_t wave_id, amd_dbgapi_register_id_t register_id, amd_dbgapi_size_t register_count) AMD_DBGAPI_VERSION_0_24
 Prefetch register values. More...
 

Detailed Description

Operations related to AMD GPU register access.

Macro Definition Documentation

◆ AMD_DBGAPI_REGISTER_CLASS_NONE

#define AMD_DBGAPI_REGISTER_CLASS_NONE   (amd_dbgapi_register_class_id_t{ 0 })

The NULL register class handle.

◆ AMD_DBGAPI_REGISTER_NONE

#define AMD_DBGAPI_REGISTER_NONE   (amd_dbgapi_register_id_t{ 0 })

The NULL register handle.

Enumeration Type Documentation

◆ amd_dbgapi_register_class_info_t

Register class queries that are supported by amd_dbgapi_architecture_register_class_get_info.

Each query specifies the type of data returned in the value argument to amd_dbgapi_architecture_register_class_get_info.

Enumerator
AMD_DBGAPI_REGISTER_CLASS_INFO_NAME 

Return the register class name.

The type of this attribute is a pointer to a NUL terminated char. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.

◆ amd_dbgapi_register_class_state_t

Indication of whether a register is a member of a register class.

Enumerator
AMD_DBGAPI_REGISTER_CLASS_STATE_NOT_MEMBER 

The register is not a member of the register class.

AMD_DBGAPI_REGISTER_CLASS_STATE_MEMBER 

The register is a member of the register class.

◆ amd_dbgapi_register_info_t

Register queries that are supported by amd_dbgapi_architecture_register_get_info and amd_dbgapi_wave_register_get_info.

Each query specifies the type of data returned in the value argument to amd_dbgapi_architecture_register_get_info and amd_dbgapi_wave_register_get_info.

Enumerator
AMD_DBGAPI_REGISTER_INFO_NAME 

Return the register name.

The type of this attribute is a pointer to a NUL terminated char. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.

AMD_DBGAPI_REGISTER_INFO_SIZE 

Return the size of the register in bytes.

The size of a register may vary depending on the lane count of the wave which can be obtained by the AMD_DBGAPI_WAVE_INFO_LANE_COUNT query. For example, the execution mask register, condition code register, and all vector registers vary by the lane count of the wave. Not supported for the amd_dbgapi_architecture_register_get_info. The type of this attribute is amd_dbgapi_size_t.

AMD_DBGAPI_REGISTER_INFO_TYPE 

Return the register type as a C style type string.

This can be used as the default type to use when displaying values of the register. The type string syntax is defined by the following BNF syntax:

type ::= integer_type  | float_type | array_type | function_type
integer_type ::= "uint32" | "uint64"
float_type ::=  "float" | "double"
array_type ::= ( integer_type | float_type ) "[" integer "]"
function_type ::= "void(void)"
integer ::= digit | ( digit integer )
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

The type size matches the size of the register. uint32 and float types are 4 bytes. unit64 and double types are 8 bytes. void(void) is the size of a global address.

The type of this attribute is a pointer to a NUL terminated char. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.

Function Documentation

◆ amd_dbgapi_architecture_register_class_get_info()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_class_get_info ( amd_dbgapi_architecture_id_t  architecture_id,
amd_dbgapi_register_class_id_t  register_class_id,
amd_dbgapi_register_class_info_t  query,
size_t  value_size,
void *  value 
)

Query information about a register class of an architecture.

amd_dbgapi_register_class_info_t specifies the queries supported and the type returned using the value argument.

Parameters
[in]architecture_idThe architecture to which the register class belongs.
[in]register_class_idThe handle of the register class being queried.
[in]queryThe query being requested.
[in]value_sizeSize of the memory pointed to by value. Must be equal to the byte size of the query result.
[out]valuePointer to memory where the query result is stored.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in value.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_CLASS_IDregister_class_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL or query is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size does not match the size of the result. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate value returns NULL. value is unaltered.

◆ amd_dbgapi_architecture_register_class_list()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_class_list ( amd_dbgapi_architecture_id_t  architecture_id,
size_t *  register_class_count,
amd_dbgapi_register_class_id_t **  register_classes 
)

Report the list of register classes supported by the architecture.

The order of the register handles in the list is stable between calls.

Parameters
[in]architecture_idThe architecture being queried.
[out]register_class_countThe number of architecture register classes.
[out]register_classesA pointer to an array of amd_dbgapi_register_class_id_t with register_class_count elements. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in register_class_count and register_classes.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized; and register_class_count and register_classes are unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized; and register_class_count and register_classes are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. register_class_count and register_classes are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTregister_class_count or register_classes are NULL. register_class_count and register_classes are unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate register_classes returns NULL. register_class_count and register_classes are unaltered.

◆ amd_dbgapi_architecture_register_get_info()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_get_info ( amd_dbgapi_architecture_id_t  architecture_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_register_info_t  query,
size_t  value_size,
void *  value 
)

Query information about a register of an architecture.

amd_dbgapi_register_info_t specifies the queries supported and the type returned using the value argument.

Parameters
[in]architecture_idThe architecture to which the register belongs.
[in]register_idThe handle of the register being queried.
[in]queryThe query being requested.
[in]value_sizeSize of the memory pointed to by value. Must be equal to the byte size of the query result.
[out]valuePointer to memory where the query result is stored.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in value.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDwave_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid for architecture_id. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL, or query is invalid or not supported for an architecture. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size does not match the size of the result. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate value returns NULL. value is unaltered.

◆ amd_dbgapi_architecture_register_list()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_architecture_register_list ( amd_dbgapi_architecture_id_t  architecture_id,
size_t *  register_count,
amd_dbgapi_register_id_t **  registers 
)

Report the list of registers supported by the architecture.

This list is all the registers the architecture can support, but a specific wave may not have all these registers. For example, AMD GPU architectures can specify the number of vector and scalar registers when a wave is created. Use the amd_dbgapi_wave_register_list operation to determine the registers supported by a specific wave.

The order of the register handles in the list is stable between calls and registers on the same major class are contiguous in ascending hardware number order.

Parameters
[in]architecture_idThe architecture being queried.
[out]register_countThe number of architecture registers.
[out]registersA pointer to an array of amd_dbgapi_register_id_t with register_count elements. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in register_count and registers.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized; and register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized; and register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTregister_count or registers are NULL. register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate registers returns NULL. register_count and registers are unaltered.

◆ amd_dbgapi_dwarf_register_to_register()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_dwarf_register_to_register ( amd_dbgapi_architecture_id_t  architecture_id,
uint64_t  dwarf_register,
amd_dbgapi_register_id_t register_id 
)

Return a register handle from an AMD GPU DWARF register number.

See User Guide for AMDGPU Backend - Code Object - DWARF - Register Mapping.

Parameters
[in]architecture_idThe architecture of the DWARF register.
[in]dwarf_registerThe AMD GPU DWARF register number.
[out]register_idThe register handle that corresponds to the DWARF register ID.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in register_id.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and register_id is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and register_id is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. register_id is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTdwarf_register_id is not valid for the architecture or register_id is NULL. register_id is unaltered.

◆ amd_dbgapi_prefetch_register()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_prefetch_register ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_wave_id_t  wave_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_size_t  register_count 
)

Prefetch register values.

A hint to indicate that a range of registers may be read using amd_dbgapi_read_register in the future. This can improve the performance of reading registers as the library may be able to batch the prefetch requests into one request.

The wave must be stopped. If the wave is resumed, then any prefetch requests for registers that were not subsequently read may be discarded and so provide no performance benefit. Prefetch requests for registers that are never subsequently read may in fact reduce performance.

The registers to prefetch are specified as the first register and the number of registers. The first register can be any register supported by the wave. The number of registers is in terms of the wave register order returned by amd_dbgapi_wave_register_list. If the number exceeds the number of wave registers, then only up to the last wave register is prefetched.

The register handle must be valid for the architecture, and the wave must have allocated that register.

Parameters
[in]process_idThe process to which the wave belongs.
[in]wave_idThe wave being queried for the register.
[in]register_idThe first register being requested.
[in]register_countThe number of registers being requested.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully. Registers may be prefetched.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. No registers are prefetched.
AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_IDwave_id is invalid. No registers are prefetched.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid for the architecture of wave_id, or not allocated for wave_id. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_WAVE_NOT_STOPPEDwave_id is not stopped. No registers are prefetched.

◆ amd_dbgapi_read_register()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_read_register ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_wave_id_t  wave_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_size_t  offset,
amd_dbgapi_size_t  value_size,
void *  value 
)

Read a register.

value_size bytes are read from the register starting at offset into value.

The wave must be stopped.

The register handle must be valid for the architecture, and the wave must have allocated that register.

The size of the register can vary depending on the wave. The register size can be obtained using amd_dbgapi_wave_register_get_info with the AMD_DBGAPI_REGISTER_INFO_SIZE query.

Parameters
[in]process_idThe process to which the wave belongs.
[in]wave_idThe wave to being queried for the register.
[in]register_idThe register being requested.
[in]offsetThe first byte to start reading the register. The offset is zero based starting from the least significant byte of the register.
[in]value_sizeThe number of bytes to read from the register which must be greater than 0 and less than the size of the register minus offset.
[out]valueThe bytes read from the register. Must point to an array of at least value_size bytes.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and value is set to value_size bytes starting at offset from the contents of the register.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. value are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_IDwave_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid for the architecture of wave_id, or not allocated for wave_id. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_WAVE_NOT_STOPPEDwave_id is not stopped. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size is 0 or greater than the size of the register minus offset. value is unaltered.

◆ amd_dbgapi_register_is_in_register_class()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_register_is_in_register_class ( amd_dbgapi_architecture_id_t  architecture_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_register_class_id_t  register_class_id,
amd_dbgapi_register_class_state_t register_class_state 
)

Determine if a register is a member of a register class.

The register and register class must both belong to the same architecture.

Parameters
[in]architecture_idThe architecture of the register class and register.
[in]register_idThe handle of the register being queried.
[in]register_class_idThe handle of the register class being queried.
[out]register_class_stateAMD_DBGAPI_REGISTER_CLASS_STATE_NOT_MEMBER if the register is not in the register class. AMD_DBGAPI_REGISTER_CLASS_STATE_MEMBER if the register is in the register class.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in register_class_state.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and register_class_state is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and register_class_state is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. register_class_state is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid for architecture_id. register_class_state is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_CLASS_IDregister_class_id is invalid for architecture_id. register_class_state is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTregister_class_state is NULL. register_class_state is unaltered.

◆ amd_dbgapi_wave_register_get_info()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_wave_register_get_info ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_wave_id_t  wave_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_register_info_t  query,
size_t  value_size,
void *  value 
)

Query information about a register of a wave.

amd_dbgapi_register_info_t specifies the queries supported and the type returned using the value argument.

Parameters
[in]process_idThe process to which the wave belongs.
[in]wave_idThe wave to which the register belongs.
[in]register_idThe handle of the register being queried.
[in]queryThe query being requested.
[in]value_sizeSize of the memory pointed to by value. Must be equal to the byte size of the query result.
[out]valuePointer to memory where the query result is stored.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in value.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_IDwave_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL or query is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size does not match the size of the result. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate value returns NULL. value is unaltered.

◆ amd_dbgapi_wave_register_list()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_wave_register_list ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_wave_id_t  wave_id,
size_t *  register_count,
amd_dbgapi_register_id_t **  registers 
)

Report the list of registers supported by a wave.

This list is the registers allocated for a specific wave and may not be all the registers supported by the architecture. For example, AMD GPU architectures can specify the number of vector and scalar registers when a wave is created. Use the amd_dbgapi_architecture_register_list operation to determine the full set of registers supported by the architecture.

The order of the register handles in the list is stable between calls. It is equal to, or a subset of, those returned by amd_dbgapi_architecture_register_list and in the same order.

Parameters
[in]process_idThe process to which the wave belongs.
[in]wave_idThe wave being queried.
[out]register_countThe number of wave registers.
[out]registersA pointer to an array of amd_dbgapi_register_id_t with register_count elements. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in register_count and registers.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized; and register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized; and register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARCHITECTURE_IDarchitecture_id is invalid. register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTregister_count or registers are NULL. register_count and registers are unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate registers returns NULL. register_count and registers are unaltered.

◆ amd_dbgapi_write_register()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_write_register ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_wave_id_t  wave_id,
amd_dbgapi_register_id_t  register_id,
amd_dbgapi_size_t  offset,
amd_dbgapi_size_t  value_size,
const void *  value 
)

Write a register.

value_size bytes are written into the register starting at offset.

The wave must be stopped.

The register handle must be valid for the architecture, and the wave must have allocated that register.

The size of the register can vary depending on the wave. The register size can be obtained using amd_dbgapi_wave_register_get_info with the AMD_DBGAPI_REGISTER_INFO_SIZE query.

Parameters
[in]process_idThe process to which the wave belongs.
[in]wave_idThe wave to being queried for the register.
[in]register_idThe register being requested.
[in]offsetThe first byte to start writing the register. The offset is zero based starting from the least significant byte of the register.
[in]value_sizeThe number of bytes to write to the register which must be greater than 0 and less than the size of the register minus offset.
[in]valueThe bytes to write to the register. Must point to an array of at least value_size bytes.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and value_size bytes have been written to the contents of the register starting at offset.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and the register is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized. The register is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. The register is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_IDwave_id is invalid. The register is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_REGISTER_IDregister_id is invalid for the architecture of wave_id, or not allocated for wave_id. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_WAVE_NOT_STOPPEDwave_id is not stopped. The register is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL. The register is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size is 0 or greater than the size of the register minus offset. The register is unaltered.