Add functions to decode RVC load and store instructions for watchpoints
This commit adds support for RVC (compressed) load and store instructions.
https://github.com/riscv-collab/riscv-openocd/issues/688 https://github.com/riscv-collab/riscv-openocd/pull/291
For GDB to fully support hardware watchpoints, OpenOCD needs to tell GDB which data address has been hit. OpenOCD relies on a target-specific hit_watchpoint function to do this. If GDB is not given the address, it will not print the hit variable name or its old and new value.
There does not seem to be a way for the hardware to tell us which trigger was hit (0.13 introduced the 'hit bit' but this is optional). Alternatively, we can decode the instruction at dpc and find out which memory address it accesses.
Converted the pull request to a draft. It is necessary to add processing for Store/Load from extensions "F" and "D"
To check all the commits you can use it on the output of the diff
Thank you!
Check all the commits
total: 0 errors, 0 warnings, 0 checks, 517 lines checked
Your patch has no obvious style problems and is ready for submission.
NOTE: Ignored message types: AVOID_EXTERNS BLOCK_COMMENT_STYLE COMPLEX_MACRO CONST_STRUCT ENOSYS FILE_PATH_CHANGES GERRIT_CHANGE_ID LINE_SPACING LOGICAL_CONTINUATIONS MACRO_WITH_FLOW_CONTROL NEW_TYPEDEFS PARENTHESIS_ALIGNMENT PREFER_DEFINED_ATTRIBUTE_MACRO PREFER_FALLTHROUGH PREFER_KERNEL_TYPES SPLIT_STRING SSCANF_TO_KSTRTO SWITCH_CASE_INDENT_LEVEL TRACING_LOGGING VOLATILE
@TommyMurphyTM1234, could you please take a look if you have the time? @JanMatCodasip, @MarekVCodasip, I would greatly appreciate your input.
@MrAlexei Thank you for the contribution and I am sorry for a not very timely review. I will be able to take a look at the changes tomorrow morning.
@TommyMurphyTM1234 or @MrAlexei, please, don't forget to mark the above threads as resolved when done so.
Thank you.
@JanMatCodasip
Also, @MrAlexei, how have you tested your changes?
I've tested regression tests with Spike (w/o the hit bit in the mcontrol) using the riscv-test project and manual testing for RVC instructions.
@aap-sc @MrAlexei Please, what is the status on the two last currently open threads (1, 2) in this PR? Thank you.
@JanMatCodasip
@aap-sc @MrAlexei Please, what is the status on the two last currently open threads (1, 2) in this PR? Thank you.
My understanding is that these are not addressed (as of yet). However, these are not blockers. Given the size of the change I don't have strong objections against merging this. It's just we'll have to follow up with additional patches that should address these issues.
@aap-sc @MrAlexei Please, what is the status on the two last currently open threads (1, 2) in this PR? Thank you.
I've finished working on these last threads. Thank you.
Thank you all so much for the review!