From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfRGX-0004Be-9I for qemu-devel@nongnu.org; Fri, 25 Sep 2015 07:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfRGT-0001ha-RJ for qemu-devel@nongnu.org; Fri, 25 Sep 2015 07:34:13 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:35490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfRGT-0001h1-KX for qemu-devel@nongnu.org; Fri, 25 Sep 2015 07:34:09 -0400 Received: by lacrr8 with SMTP id rr8so15771418lac.2 for ; Fri, 25 Sep 2015 04:34:08 -0700 (PDT) References: <1442227888-11467-1-git-send-email-serge.fdrv@gmail.com> <55FC1A8E.1070401@gmail.com> From: Sergey Fedorov Message-ID: <5605312E.5020908@gmail.com> Date: Fri, 25 Sep 2015 14:34:06 +0300 MIME-Version: 1.0 In-Reply-To: <55FC1A8E.1070401@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-arm: fix CPU breakpoint handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers 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 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. Best regards, Sergey