diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-09-12 14:06:48 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-09-12 14:06:48 +0100 |
commit | 08225676b279fd14683275b65ed701972e008043 (patch) | |
tree | a44a2fddb77bb5781fb29f0a8c51b7adf6c7c8f0 /exec.c | |
parent | 3ee887e8ff7610d83bf05b0ebd5a1d891f0d8816 (diff) |
exec.c: Record watchpoint fault address and direction
When we check whether we've hit a watchpoint we know the address
that we were attempting to access and whether it was a read or a
write. Record this information in the CPUWatchpoint struct so that
target-specific code can report it to the guest.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1673,7 +1673,12 @@ static void check_watchpoint(int offset, int len, int flags) QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { if (cpu_watchpoint_address_matches(wp, vaddr, len) && (wp->flags & flags)) { - wp->flags |= BP_WATCHPOINT_HIT; + if (flags == BP_MEM_READ) { + wp->flags |= BP_WATCHPOINT_HIT_READ; + } else { + wp->flags |= BP_WATCHPOINT_HIT_WRITE; + } + wp->hitaddr = vaddr; if (!cpu->watchpoint_hit) { cpu->watchpoint_hit = wp; tb_check_watchpoint(cpu); |