aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-08-14 09:43:24 -0700
committerGitHub <noreply@github.com>2023-08-14 09:43:24 -0700
commit68ad364f273acb6d54d8763638230f126a5046a0 (patch)
treeecb4ef13d449db5796379f44e58a5fa0761dfa03
parentee5c5c292fd04f62f88fc0ae3a8d69c403aa2803 (diff)
parentbb7852646e1b971ae88215693447235f02a60d02 (diff)
downloadriscv-openocd-68ad364f273acb6d54d8763638230f126a5046a0.zip
riscv-openocd-68ad364f273acb6d54d8763638230f126a5046a0.tar.gz
riscv-openocd-68ad364f273acb6d54d8763638230f126a5046a0.tar.bz2
Merge pull request #897 from aap-sc/aap-sc/wp_data_not_implemented
add diagnostics for non-implemented data watchpoints
-rw-r--r--src/target/riscv/riscv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 7962a47..3a3ba4a 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -1293,6 +1293,14 @@ static void trigger_from_watchpoint(struct trigger *trigger,
int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
+ // NOTE: typeof is needed because of upstream OpenOCD bug. This should be
+ // replaced by WATCHPOINT_IGNORE_DATA_VALUE_MASK once it is available
+ // See: https://review.openocd.org/c/openocd/+/7840
+ if (watchpoint->mask != ~(typeof(watchpoint->mask))0) {
+ LOG_TARGET_ERROR(target, "Watchpoints on data values are not implemented");
+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ }
+
struct trigger trigger;
trigger_from_watchpoint(&trigger, watchpoint);