Skip to content

Commit 39d4c50

Browse files
authored
Merge pull request #1274 from en-sc/en-sc/add-more-info-in-sample-memory
target/riscv: improve error messaging in case `sbasize` is zero
2 parents 295166b + 89f0573 commit 39d4c50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/target/riscv/riscv-013.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,8 +2610,8 @@ static int sample_memory_bus_v1(struct target *target,
26102610
{
26112611
RISCV013_INFO(info);
26122612
unsigned int sbasize = get_field(info->sbcs, DM_SBCS_SBASIZE);
2613-
if (sbasize > 64) {
2614-
LOG_TARGET_ERROR(target, "Memory sampling is only implemented for sbasize <= 64.");
2613+
if (sbasize == 0 || sbasize > 64) {
2614+
LOG_TARGET_ERROR(target, "Memory sampling is only implemented for non-zero sbasize <= 64.");
26152615
return ERROR_NOT_IMPLEMENTED;
26162616
}
26172617

0 commit comments

Comments
 (0)