From patchwork Mon Sep 15 13:01:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 2847 Received: (qmail 26779 invoked by alias); 15 Sep 2014 13:01:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26765 invoked by uid 89); 15 Sep 2014 13:01:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 15 Sep 2014 13:01:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CE848116301 for ; Mon, 15 Sep 2014 09:01:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yVKzV68CJnd1 for ; Mon, 15 Sep 2014 09:01:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9FFE91162FE for ; Mon, 15 Sep 2014 09:01:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5F47940E17; Mon, 15 Sep 2014 06:01:06 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint. Date: Mon, 15 Sep 2014 06:01:02 -0700 Message-Id: <1410786062-19274-1-git-send-email-brobecker@adacore.com> Hello! Re: question about ARM watchpoints https://www.sourceware.org/ml/gdb/2014-09/msg00000.html This patch fixes an issue with watchpoints on ARM targets, where the debugger stops 2 instructions after the instruction causing the watchpoint. GDB is expected to stop at the next instruction. The problem is caused by the fact that GDB does an extra single-step after receiving the watchpoint notification, because the have_nonsteppable_watchpoint gdbarch attribute is set for ARM targets. Our experiments indicate that this is incorrect, at least for the versions of ARM that we tested on (ARMv7). We tried to get confirmation of this through the ARM documentation, but did not manage to get a clear answer. So, in light of evidence that the current code is wrong for some versions of ARM, and with the lack of evidence regarding the versions of ARM we could not test on, this patch simply unsets this gdbarch attribute for all versions of ARM. The plan is to refine this later on if/when we find that some systems behave differently. gdb/ChangeLog: * arm-tdep.c (arm_gdbarch_init): Remove call to set_gdbarch_have_nonsteppable_watchpoint. Unless there are comments, I will commit the patch in a week. Thank you! --- gdb/arm-tdep.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f9feb52..990c4ad 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -10446,9 +10446,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (tdep->arm_abi == ARM_ABI_AUTO) tdep->arm_abi = ARM_ABI_APCS; - /* Watchpoints are not steppable. */ - set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); - /* We used to default to FPA for generic ARM, but almost nobody uses that now, and we now provide a way for the user to force the model. So default to the most useful variant. */