OpenOCD
debug_reg_printer.h File Reference
Include dependency graph for debug_reg_printer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  riscv_debug_reg_show { RISCV_DEBUG_REG_SHOW_ALL , RISCV_DEBUG_REG_HIDE_ALL_0 , RISCV_DEBUG_REG_HIDE_UNNAMED_0 }
 

Functions

unsigned int riscv_debug_reg_to_s (char *buf, enum riscv_debug_reg_ordinal reg_ordinal, struct riscv_debug_reg_ctx context, uint64_t value, enum riscv_debug_reg_show show)
 This function is used to fill a buffer with a decoded string representation of register's value. More...
 

Enumeration Type Documentation

◆ riscv_debug_reg_show

Enumerator
RISCV_DEBUG_REG_SHOW_ALL 
RISCV_DEBUG_REG_HIDE_ALL_0 
RISCV_DEBUG_REG_HIDE_UNNAMED_0 

Definition at line 8 of file debug_reg_printer.h.

Function Documentation

◆ riscv_debug_reg_to_s()

unsigned int riscv_debug_reg_to_s ( char *  buf,
enum riscv_debug_reg_ordinal  reg_ordinal,
struct riscv_debug_reg_ctx  context,
uint64_t  value,
enum riscv_debug_reg_show  show 
)

This function is used to fill a buffer with a decoded string representation of register's value.

Parameters
bufIf non-NULL, the buffer to write the string into. Otherwise, the function does not perform any writes, it just calculates the number of characters used.
reg_ordinalThe ordinal of the register.
contextThe structure, containing the information about the target, necessary to decode the register.
valueThe value to be decoded.

Returns the number of characters used by the string representation (excluding '\0').

Example: const struct struct riscv_debug_reg_ctx context = { .abits = { .value = <abits value>, .is_set = true } }; char buf[riscv_debug_reg_to_s(NULL, DTM_DMI_ORDINAL, context, <dmi value>) + 1] riscv_debug_reg_to_s(buf, DTM_DMI_ORDINAL, context, <dmi value>);

Definition at line 91 of file debug_reg_printer.c.

References get_len_or_sprintf(), get_riscv_debug_reg_info(), length, reg::name, print_number(), and riscv_debug_reg_fields_to_s().

Referenced by decode_dmi(), and log_debug_reg().