From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn5WM-00020S-FX for qemu-devel@nongnu.org; Fri, 16 Oct 2015 09:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn5WL-0000jx-Jn for qemu-devel@nongnu.org; Fri, 16 Oct 2015 09:58:10 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn5WL-0000ht-DZ for qemu-devel@nongnu.org; Fri, 16 Oct 2015 09:58:09 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Zn5WK-0003mt-5A for qemu-devel@nongnu.org; Fri, 16 Oct 2015 14:58:08 +0100 From: Peter Maydell Date: Fri, 16 Oct 2015 14:58:06 +0100 Message-Id: <1445003887-14475-13-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1445003887-14475-1-git-send-email-peter.maydell@linaro.org> References: <1445003887-14475-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 12/13] target-arm: Fix GDB breakpoint handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Sergey Fedorov 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 Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target-arm/op_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index 1425a1d..67b18c0 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -897,6 +897,12 @@ void arm_debug_excp_handler(CPUState *cs) } } } else { + uint64_t pc = is_a64(env) ? env->pc : env->regs[15]; + + if (cpu_breakpoint_test(cs, pc, BP_GDB)) { + return; + } + if (check_breakpoints(cpu)) { bool same_el = (arm_debug_target_el(env) == arm_current_el(env)); if (extended_addresses_enabled(env)) { -- 1.9.1