From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9606 invoked by alias); 5 Jul 2013 17:10:06 -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 9590 invoked by uid 89); 5 Jul 2013 17:10:05 -0000 X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,KAM_TIME,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 05 Jul 2013 17:10:05 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Jul 2013 18:04:34 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 5 Jul 2013 18:04:31 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 332E21B0805F for ; Fri, 5 Jul 2013 18:10:00 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r65H9mbm49610870 for ; Fri, 5 Jul 2013 17:09:48 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r65H9xgj007374 for ; Fri, 5 Jul 2013 11:09:59 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-143.boeblingen.de.ibm.com [9.152.212.143]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r65H9wro007371; Fri, 5 Jul 2013 11:09:59 -0600 From: Andreas Arnez To: lgustavo@codesourcery.com Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] wp-replication: Fix test case loop References: <87ppuxasyo.fsf@br87z6lw.de.ibm.com> <51D6F295.2070306@codesourcery.com> Date: Fri, 05 Jul 2013 17:10:00 -0000 In-Reply-To: <51D6F295.2070306@codesourcery.com> (Luis Machado's message of "Fri, 05 Jul 2013 13:21:41 -0300") Message-ID: <87li5laq6w.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13070517-3548-0000-0000-000005DC15E2 X-SW-Source: 2013-07/txt/msg00205.txt.bz2 Luis Machado writes: > On 07/05/2013 01:10 PM, Andreas Arnez wrote: >> When executing wp-replication.exp on S/390, the loop that counts the >> number of available hardware watchpoints does not terminate properly, >> because *all* "watch" commands yield "hardware watchpoints". >> >> Since the C source code is not prepared for more than NR_THREADS >> hardware watchpoints anyhow, I suggest to add the appropriate exit >> condition to the loop. > > That's an interesting behavior. Are the resources on s390 nearly > unlimited for hardware watchpoints? Does it run out of hardware > watchpoints eventually? Well, that would be nice, wouldn't it? But sorry, no. On s390 the hardware can generate so-called "PER storage alteration events" (PER = program event recording) for a single contiguous memory area. s390-nat.c chooses this area such that all desired watchpoints lie within. Thus what happens in wp-replication.exp is that the PER ending address is increased with every loop iteration, but no hardware limit is reached. > If s390 doesn't run out of hardware watchpoints, i'd add a comment to > the testcase explaining why we have this condition. Sure. How about this then? diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp index 8927a43..c6a13b9 100644 --- a/gdb/testsuite/gdb.threads/wp-replication.exp +++ b/gdb/testsuite/gdb.threads/wp-replication.exp @@ -81,6 +81,14 @@ while { $done == 0 } { gdb_test_multiple "continue" "watchpoint created successfully" { -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" { incr hwatch_count + + # Some targets (like S/390) behave as though supporting + # unlimited hardware watchpoints. In this case we just take a + # safe exit out of the loop. + if { $hwatch_count == $NR_THREADS } { + set done 1 + break + } } -re ".*Could not insert hardware watchpoint.*$gdb_prompt $" { set done 1