From patchwork Mon Mar 20 17:14:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 19660 Received: (qmail 13917 invoked by alias); 20 Mar 2017 17:14:40 -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 12865 invoked by uid 89); 20 Mar 2017 17:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=followings X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Mar 2017 17:14:38 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2KHEADk086614 for ; Mon, 20 Mar 2017 13:14:38 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 29ajjqjutj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Mar 2017 13:14:37 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Mar 2017 17:14:35 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Mar 2017 17:14:33 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2KHEXRU31195166 for ; Mon, 20 Mar 2017 17:14:33 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F4F0A4059 for ; Mon, 20 Mar 2017 17:14:13 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 617A4A4053 for ; Mon, 20 Mar 2017 17:14:13 +0000 (GMT) Received: from oc1027705133.ibm.com (unknown [9.152.212.162]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Mon, 20 Mar 2017 17:14:13 +0000 (GMT) From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH] Fix spurious FAILs with examine-backward.exp Date: Mon, 20 Mar 2017 18:14:30 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17032017-0012-0000-0000-000004ED1095 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032017-0013-0000-0000-000017B17D1C Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-20_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703200148 X-IsSubscribed: yes The test case examine-backward.exp issues the command "x/-s" after the end of the first string in TestStrings, but without making sure that this string is preceded by a string terminator. Thus GDB may spuriously print some random characters from before that string, and then the test fails. This patch assures that TestStrings is preceded by a string terminator. gdb/testsuite/ChangeLog: * gdb.base/examine-backward.c (Barrier): New character array constant, to ensure that TestStrings is preceded by a string terminator. --- gdb/testsuite/gdb.base/examine-backward.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c index 5e9162a..ab04eff 100644 --- a/gdb/testsuite/gdb.base/examine-backward.c +++ b/gdb/testsuite/gdb.base/examine-backward.c @@ -32,6 +32,10 @@ literals. The content of each array is the same as followings: }; */ +const char Barrier[] = { + 0x00, +}; + const char TestStrings[] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,