Merge pull request #897 from aap-sc/aap-sc/wp_data_not_implemented

add diagnostics for non-implemented data watchpoints
This commit is contained in:
Tim Newsome 2023-08-14 09:43:24 -07:00 committed by GitHub
commit 68ad364f27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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);