diff options
author | Francesco Cagnin <fcagnin@quarkslab.com> | 2023-06-06 10:19:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-06-06 10:19:30 +0100 |
commit | f41520402c3a917c378ad166c2c76feb64608b09 (patch) | |
tree | 48d405858899ae3568b420f894d832e730ecff12 /accel/hvf/hvf-all.c | |
parent | ce799a04b2987e54a3f29b2139c9610ac8c467c9 (diff) |
hvf: add breakpoint handlers
Required for guest debugging. The code has been structured like the KVM
counterpart.
Signed-off-by: Francesco Cagnin <fcagnin@quarkslab.com>
Message-id: 20230601153107.81955-4-fcagnin@quarkslab.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'accel/hvf/hvf-all.c')
-rw-r--r-- | accel/hvf/hvf-all.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 0043f4d308..e983c23ad7 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -44,3 +44,20 @@ void assert_hvf_ok(hv_return_t ret) abort(); } + +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, target_ulong pc) +{ + struct hvf_sw_breakpoint *bp; + + QTAILQ_FOREACH(bp, &hvf_state->hvf_sw_breakpoints, entry) { + if (bp->pc == pc) { + return bp; + } + } + return NULL; +} + +int hvf_sw_breakpoints_active(CPUState *cpu) +{ + return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints); +} |