From patchwork Mon Nov 17 16:28:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 3779 Received: (qmail 10345 invoked by alias); 17 Nov 2014 16:28:49 -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 10331 invoked by uid 89); 17 Nov 2014 16:28:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 17 Nov 2014 16:28:48 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Nov 2014 16:28:45 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Nov 2014 16:28:43 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 68E4417D8056 for ; Mon, 17 Nov 2014 16:28:54 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAHGSgGv59441286 for ; Mon, 17 Nov 2014 16:28:42 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAHGSgOQ012809 for ; Mon, 17 Nov 2014 09:28:42 -0700 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sAHGSfLR012797; Mon, 17 Nov 2014 09:28:41 -0700 From: Andreas Arnez To: Pedro Alves , gdb-patches@sourceware.org Subject: [PATCH] Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case Date: Mon, 17 Nov 2014 17:28:41 +0100 Message-ID: <874mtxssee.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14111716-0025-0000-0000-000002726E66 X-IsSubscribed: yes The bp-permanent test case assumes that a NOP is exactly as long as a software breakpoint. This is not the case for the S390 "nop" instruction, which is 4 bytes long, while a software breakpoint is just 2 bytes long. The "nopr" instruction has the right size and can be used instead. Without this patch the test case fails on S390 when trying to continue after SIGTRAP on the permanent breakpoint: ... Continuing. Program received signal SIGILL, Illegal instruction. test () at /home/arnez/src/binutils-gdb/gdb/testsuite/gdb.base/bp-permanent.c:40 40 NOP; /* after permanent bp */ (gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: basics: stop at permanent breakpoint With this patch the test case succeeds without any FAILs. gdb/testsuite/ChangeLog: * gdb.base/bp-permanent.c (NOP): Define as 2-byte instead of 4-byte instruction on S390. --- gdb/testsuite/gdb.base/bp-permanent.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.base/bp-permanent.c b/gdb/testsuite/gdb.base/bp-permanent.c index a45a922..e8b4b6b 100644 --- a/gdb/testsuite/gdb.base/bp-permanent.c +++ b/gdb/testsuite/gdb.base/bp-permanent.c @@ -21,7 +21,11 @@ #include #endif +#if defined(__s390__) || defined(__s390x__) +#define NOP asm("nopr 0") +#else #define NOP asm("nop") +#endif /* Buffer holding the breakpoint instruction. */ unsigned char buffer[16];