From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119007 invoked by alias); 16 Mar 2015 15:23:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 118991 invoked by uid 89); 16 Mar 2015 15:23:20 -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,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 16 Mar 2015 15:23:16 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id CEB2E8EFD3; Mon, 16 Mar 2015 15:23:15 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2GFNDKb005693; Mon, 16 Mar 2015 11:23:15 -0400 Message-ID: <5506F561.8020108@redhat.com> Date: Mon, 16 Mar 2015 15:23:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers References: <1426257692-30461-1-git-send-email-qiyaoltc@gmail.com> <5506CDF2.4090400@redhat.com> <864mplghxp.fsf@gmail.com> In-Reply-To: <864mplghxp.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00457.txt.bz2 On 03/16/2015 02:01 PM, Yao Qi wrote: > Pedro Alves writes: > >> Hmm, is this just to save test time? If so, I'd prefer not skipping, >> as it may always catch other bugs, in the target backends or >> the kernel. > > No, watchpoint-reuse-slot.exp sets some HW breakpoint/watchpoint on some > address doesn't meet the alignment requirements by kernel, kernel > will reject the ptrace (PTRACE_SETHBPREGS) call, and some fails are > caused, for example: OK, then different wp and bp registers really is an orthogonal predicate. A better one is around the alignment requirements of a breakpoint. > > (gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 0: delete $bpnum > hbreak *(buf.byte + 0 + 1)^M > Hardware assisted breakpoint 80 at 0x410a61^M > (gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1) > stepi^M > Warning:^M > Cannot insert hardware breakpoint 80.^M > Could not insert hardware breakpoints:^M > You may have requested too many hardware breakpoints/watchpoints.^M > ^M > (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: stepi advanced > > hbreak *(buf.byte + 0 + 1)^M > Hardware assisted breakpoint 440 at 0x410a61^M > Warning:^M > Cannot insert hardware breakpoint 440.^M > Could not insert hardware breakpoints:^M > You may have requested too many hardware breakpoints/watchpoints.^M > ^M > (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted on: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1) > > Do you suggest that we don't skip these tests even requested > breakpoint/watchpoint don't go in the same slot (debugging register)? Yes. > so > that the test can cover more. If the requested address of HW > breakpoint/watchpoint doesn't meet the arch/kernel requirements, we can > skip it, is it OK? Yes, that makes sense. > > The inner loop of test has two parts, "base + 0" and "base + 1", > > append prefix "$cmd1 x $cmd2: " > with_test_prefix "$prefix: width $width, iter $x" { > with_test_prefix "base + 0" { > watch_command $cmd1 $x 0 $width > stepi > gdb_test_no_output "delete \$bpnum" > } > with_test_prefix "base + 1" { > watch_command $cmd2 $x 1 $width > stepi > gdb_test_no_output "delete \$bpnum" > } > } > > if we skip "base + 1" part, do we skip "base + 0" too? if not, prefix in > test summary "$cmd1 x $cmd2: " doesn't reflect the fact. I think skipping both is fine. Thanks, Pedro Alves