src/target/riscv: error out of the examine()
in case abits
is zero
#1238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The spec requires
abits
to be no less then 7 ( [3.1. Debug Module Interface (DMI)]):Commit a450a7d ("Fix data types around batch.{c,h}") introduced a check that issues a warning if
abits
is less then 7. The reason it's a warning and not an error -- on Spikeabits
is 6.However, if the examination is to proceed when
abits
is zero, an assert inget_dmi_scan_length()
will trigger when attempting to communicate over DMI.Link: https://github.com/JanMatCodasip/riscv-openocd/blob/a450a7d4966a19c48b2543810f5b8370af6383e5/src/target/riscv/batch.c#L25
It's impossible to communicate over DMI with
abits == 0
, so an error is returned instead of a warning in this case.Change-Id: Ice4622adccfc8304b37bc678253cc19d8ac1457e