On 28 September 2015 at 11:07, Sergey Fedorov <serge.f...@gmail.com> wrote:
> GDB breakpoints have higher priority so they have to be checked first.
> Should GDB breakpoint match, just return from the debug exception
> handler.
>
> Signed-off-by: Sergey Fedorov <serge.f...@gmail.com>
> ---
>  target-arm/op_helper.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
> index 1425a1d..1d4d8cb 100644
> --- a/target-arm/op_helper.c
> +++ b/target-arm/op_helper.c
> @@ -897,6 +897,15 @@ void arm_debug_excp_handler(CPUState *cs)
>              }
>          }
>      } else {
> +        CPUBreakpoint *bp;
> +        uint64_t pc = is_a64(env) ? env->pc : env->regs[15];
> +
> +        QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
> +            if (bp->pc == pc && !(bp->flags & BP_CPU)) {
> +                return;
> +            }
> +        }
> +

In current master you can write this more simply as

    if (cpu_breakpoint_test(cs, pc, BP_GDB)) {
        return;
    }

since rth's patchset introduced that utility function.

thanks
-- PMM

Reply via email to