Message ID | 1407806302-14295-1-git-send-email-yao@codesourcery.com |
---|---|
State | Committed |
Headers |
Received: (qmail 18160 invoked by alias); 12 Aug 2014 01:22:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 18093 invoked by uid 89); 12 Aug 2014 01:22:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Aug 2014 01:22:23 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XH0n6-0006DC-93 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 11 Aug 2014 18:22:20 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 11 Aug 2014 18:22:20 -0700 Received: from localhost.localdomain (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Mon, 11 Aug 2014 18:22:18 -0700 From: Yao Qi <yao@codesourcery.com> To: <gdb-patches@sourceware.org> Subject: [PATCH] Set breakpoint on the right line Date: Tue, 12 Aug 2014 09:18:22 +0800 Message-ID: <1407806302-14295-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes |
Commit Message
Yao Qi
Aug. 12, 2014, 1:18 a.m. UTC
In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set breakpoint on the line having "break-at-exit", gdb_breakpoint [gdb_get_line_number "break-at-exit"] However, in watchpoint-hw-hit-once.c, there are two lines having this key word: dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */ dummy = 2; /* break-at-exit */ so the test sets breakpoint on the first one, while I think it is expected to set breakpoint on the second one, as far as I can tell from the comments in watchpoint-hw-hit-once.c: /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC already stays on the line PC while entering "step"/"continue". */ This patch is to change the source matching pattern so that test can correctly set breakpoint on the right line. This patch fixes a fail we found on arm-none-eabi target. Run it again on x86_64-linux, no result changes. gdb/testsuite: 2014-08-12 Yao Qi <yao@codesourcery.com> * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the right line. --- gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 08/12/2014 09:18 AM, Yao Qi wrote: > In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set > breakpoint on the line having "break-at-exit", > > gdb_breakpoint [gdb_get_line_number "break-at-exit"] > > However, in watchpoint-hw-hit-once.c, there are two lines having > this key word: > > dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */ > dummy = 2; /* break-at-exit */ > > so the test sets breakpoint on the first one, while I think it is > expected to set breakpoint on the second one, as far as I can tell > from the comments in watchpoint-hw-hit-once.c: > > /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC > already stays on the line PC while entering "step"/"continue". */ > > This patch is to change the source matching pattern so that test > can correctly set breakpoint on the right line. This patch fixes > a fail we found on arm-none-eabi target. Run it again > on x86_64-linux, no result changes. > > gdb/testsuite: > > 2014-08-12 Yao Qi <yao@codesourcery.com> > > * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the > right line. Ping. https://sourceware.org/ml/gdb-patches/2014-08/msg00190.html
> This patch is to change the source matching pattern so that test > can correctly set breakpoint on the right line. This patch fixes > a fail we found on arm-none-eabi target. Run it again > on x86_64-linux, no result changes. > > gdb/testsuite: > > 2014-08-12 Yao Qi <yao@codesourcery.com> > > * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the > right line. I think you are right, but can you describe the error you are getting with arm-none-eabi?
On 08/19/2014 02:38 PM, Joel Brobecker wrote: > I think you are right, but can you describe the error you are getting > with arm-none-eabi? Sure, the fail is shown as below: continue^M Continuing.^M ^M *** EXIT code 0^M [Inferior 1 (Remote target) exited normally]^M (gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited) I also copy it in the commit log. Patch is pushed in.
> > I think you are right, but can you describe the error you are getting > > with arm-none-eabi? > > Sure, the fail is shown as below: > > continue^M > Continuing.^M > ^M > *** EXIT code 0^M > [Inferior 1 (Remote target) exited normally]^M > (gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited) > > I also copy it in the commit log. Patch is pushed in. I actually didn't pre-approve, but never mind :-). I think I understand, now. The problem using the first break-at-exit line was that the watchpoint would be triggering at the same location the breakpoint was inserted. So the "continue" test right after would never hit that breakpoint. If my understanding is correct, the patch is officially approved :).
On 08/19/2014 09:48 PM, Joel Brobecker wrote: > I actually didn't pre-approve, but never mind :-). > Ur, I misunderstood you, sorry. > I think I understand, now. The problem using the first break-at-exit > line was that the watchpoint would be triggering at the same location > the breakpoint was inserted. So the "continue" test right after would > never hit that breakpoint. If my understanding is correct, the patch > is officially approved :). Yes, that is correct.
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp index 53de3d5..49c0d6a 100644 --- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp +++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp @@ -29,7 +29,7 @@ if ![runto_main] { gdb_test "rwatch watchee" -gdb_breakpoint [gdb_get_line_number "break-at-exit"] +gdb_breakpoint [gdb_get_line_number "dummy = 2"] gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"