On 25.09.2015 14:34, Sergey Fedorov wrote: > On 18.09.2015 17:07, Sergey Fedorov wrote: >> On 18.09.2015 16:50, Peter Maydell wrote: >>> On 14 September 2015 at 11:51, Sergey Fedorov <serge.f...@gmail.com> wrote: >>> @@ -904,7 +913,16 @@ void arm_debug_excp_handler(CPUState *cs) >>> arm_debug_target_el(env)); >>> } >>> } else { >>> - if (check_breakpoints(cpu)) { >>> + 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; >>> + } >>> + } >>> This extra code looks right, but isn't it fixing a different bug? >> You are right, it would better come to separate patch. > Actually, I can't think of it as a separate patch. This change is really > required only if we remove check_breakpoints() here. Otherwise > check_breakpoints() calls bp_wp_matches() which do the necessary check. > ...but considering the order of breakpoint enumeration it is not so simple. The difference is when we have GDB and CPU breakpoint to the same address. In this case check_breakpoints() returns true, but we should handle GDB breakpoints first. Sorry for my misunderstanding, I will split this patch as you suggested.
Best regards, Sergey