From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJql-0002K4-FE for qemu-devel@nongnu.org; Mon, 02 Nov 2015 13:29:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtJqk-0003sh-HU for qemu-devel@nongnu.org; Mon, 02 Nov 2015 13:28:59 -0500 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:35742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJqk-0003sd-A4 for qemu-devel@nongnu.org; Mon, 02 Nov 2015 13:28:58 -0500 Received: by vkfw189 with SMTP id w189so90553960vkf.2 for ; Mon, 02 Nov 2015 10:28:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1446486668-2133-1-git-send-email-serge.fdrv@gmail.com> References: <1446486668-2133-1-git-send-email-serge.fdrv@gmail.com> From: Peter Maydell Date: Mon, 2 Nov 2015 18:28:38 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] target-arm: Fix arm_debug_excp_handler() for singlestep enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov Cc: QEMU Developers On 2 November 2015 at 17:51, Sergey Fedorov wrote: > CPU singlestep is done by generating a debug internal exception. Do not > raise a real CPU exception in case of singlestepping. > > Signed-off-by: Sergey Fedorov > --- > target-arm/op_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c > index 7929c71..67d9ffb 100644 > --- a/target-arm/op_helper.c > +++ b/target-arm/op_helper.c > @@ -909,7 +909,7 @@ void arm_debug_excp_handler(CPUState *cs) > uint64_t pc = is_a64(env) ? env->pc : env->regs[15]; > bool same_el = (arm_debug_target_el(env) == arm_current_el(env)); > > - if (cpu_breakpoint_test(cs, pc, BP_GDB)) { > + if (cs->singlestep_enabled || cpu_breakpoint_test(cs, pc, BP_GDB)) { > return; > } So I think this will mean that if we're gdbstub-single-stepping then an architectural breakpoint on the insn we're stepping won't fire. Does using a test if (!cpu_breakpoint_test(cs, pc, BP_CPU)) { return; } fix the singlestep bug too? If so I think it would probably be preferable. thanks -- PMM