Skip to content

Commit

Permalink
target/riscv: define register printers
Browse files Browse the repository at this point in the history
`riscv_debug_reg_to_s()` can be used to decode register value.  If the
pointer to buffer is `NULL` it does not print anything, just returns the
length of the string.

The format is:
`<register_value> { <field_name>=<field_value_name or field_value>, ..., }`

e.g:

`0x400382 { version=2, confstrptrvalid=invalid, hasresethaltreq=0, authbusy=ready, authenticated=true, anyhalted=1, allhalted=1, anyrunning=0, allrunning=0, anyunavail=0, allunavail=0, anynonexistent=0, allnonexistent=0, anyresumeack=0, allresumeack=0, anyhavereset=0, allhavereset=0, impebreak=1, stickyunavail=current, ndmresetpending=false, }`

`0x321009 { regno=0x1009, write=arg0, transfer=enabled, postexec=disabled, aarpostincrement=disabled, aarsize=64bit, cmdtype=0, }`

Change-Id: I63733d8d36385d89ca15de1a43139134bc488c4f
Signed-off-by: Evgeniy Naydanov <[email protected]>
  • Loading branch information
en-sc committed Aug 15, 2023
1 parent c07d925 commit 737127f
Show file tree
Hide file tree
Showing 6 changed files with 5,596 additions and 138 deletions.
5 changes: 4 additions & 1 deletion src/target/riscv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ noinst_LTLIBRARIES += %D%/libriscv.la
%D%/asm.h \
%D%/batch.h \
%D%/debug_defines.h \
%D%/debug_register_printers.h \
%D%/encoding.h \
%D%/gdb_regs.h \
%D%/opcodes.h \
Expand All @@ -15,4 +16,6 @@ noinst_LTLIBRARIES += %D%/libriscv.la
%D%/riscv-011.c \
%D%/riscv-013.c \
%D%/riscv.c \
%D%/riscv_semihosting.c
%D%/riscv_semihosting.c \
%D%/debug_defines.c \
%D%/debug_register_printers.c
Loading

0 comments on commit 737127f

Please sign in to comment.