Jan Kiszka wrote:
This adds length support for watchpoints. To keep things simple, only
aligned watchpoints are accepted.

--- a/qemu/exec.c
+++ b/qemu/exec.c
@@ -1328,14 +1328,19 @@ static void breakpoint_invalidate(CPUSta
 int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,
                           int flags, CPUWatchpoint **watchpoint)
 {
+    target_ulong len_mask = ~(len - 1);
     CPUWatchpoint *wp;
+ /* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */
+    if ((len != 1 && len != 2 && len != 4) || (addr & ~len_mask))
+        return -EINVAL;
+

It would be good to support 8-byte watchpoints (as x86-64 does); also, print a message if we deny a breakpoint due to bad alignment, so people know where to fix this.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to