Commit 07e2863d authored by Max Filippov's avatar Max Filippov Committed by Peter Maydell

exec.c: fix setting 1-byte-long watchpoints

With commit 05068c0d 'exec.c: Relax restrictions on watchpoint length
and alignment' it's no longer possible to set 1-byte-long watchpoint
because of incorrect address range check.
Fix that by changing condition that checks for address wraparound.
Signed-off-by: default avatarMax Filippov <>
Reviewed-by: default avatarPeter Maydell <>
Signed-off-by: default avatarPeter Maydell <>
parent 4852ee95
......@@ -595,7 +595,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
CPUWatchpoint *wp;
/* forbid ranges which are empty or run off the end of the address space */
if (len == 0 || (addr + len - 1) <= addr) {
if (len == 0 || (addr + len - 1) < addr) {
error_report("tried to set invalid watchpoint at %"
VADDR_PRIx ", len=%" VADDR_PRIu, addr, len);
return -EINVAL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment