From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtXUA-0007Ve-2l for qemu-devel@nongnu.org; Tue, 03 Nov 2015 04:02:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtXU1-00071U-9J for qemu-devel@nongnu.org; Tue, 03 Nov 2015 04:02:34 -0500 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:33894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtXU1-00071M-2a for qemu-devel@nongnu.org; Tue, 03 Nov 2015 04:02:25 -0500 Received: by lfgh9 with SMTP id h9so9907810lfg.1 for ; Tue, 03 Nov 2015 01:02:24 -0800 (PST) References: <1446486668-2133-1-git-send-email-serge.fdrv@gmail.com> From: Sergey Fedorov Message-ID: <5638781E.6040309@gmail.com> Date: Tue, 3 Nov 2015 12:02:22 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Peter Maydell Cc: QEMU Developers On 02.11.2015 21:28, Peter Maydell wrote: > 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. Actually, it is supposed that gdbstub breakpoints should be handled before CPU breakpoints. So I think we should rather do this way: if (cpu_breakpoint_test(cs, pc, BP_GDB) || !cpu_breakpoint_test(cs, pc, BP_CPU)) { return; } Thanks, Sergey