From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id BF5B2385801A for ; Tue, 2 Nov 2021 15:41:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF5B2385801A Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1A2FLLKU007902; Tue, 2 Nov 2021 15:41:12 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3c31rhhvw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Nov 2021 15:41:12 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1A2FcsX7032028; Tue, 2 Nov 2021 15:41:11 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 3c22ts5d9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Nov 2021 15:41:11 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1A2FfASA17170756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Nov 2021 15:41:10 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C39DAE06A; Tue, 2 Nov 2021 15:41:10 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F63EAE067; Tue, 2 Nov 2021 15:41:10 +0000 (GMT) Received: from lexx (unknown [9.160.166.237]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 2 Nov 2021 15:41:09 +0000 (GMT) Message-ID: <958ff6cb8e93ee7c9104a8502e446d06bfa1c56f.camel@vnet.ibm.com> Subject: Re: [PATCH][gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases From: will schmidt To: Tom de Vries , gdb-patches@sourceware.org Date: Tue, 02 Nov 2021 10:41:09 -0500 In-Reply-To: <20211029194516.GA27121@delia> References: <20211029194516.GA27121@delia> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8cxp5zH7R5xytG4peFUu6Uvaqzomqnct X-Proofpoint-ORIG-GUID: 8cxp5zH7R5xytG4peFUu6Uvaqzomqnct X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-02_08,2021-11-02_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1011 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111020091 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2021 15:41:14 -0000 On Fri, 2021-10-29 at 21:45 +0200, Tom de Vries via Gdb-patches wrote: > Hi, > > On powerpc64le-linux, with test-case gdb.arch/powerpc-addpcis.exp I > run into > SIGILL: > ... > (gdb) PASS: gdb.arch/powerpc-addpcis.exp: get hexadecimal valueof > "$r3" > stepi^M > ^M > Program terminated with signal SIGILL, Illegal instruction.^M > The program no longer exists.^M > (gdb) PASS: gdb.arch/powerpc-addpcis.exp: set r4 > ... > because it's a power9 insn, and I'm running on a power8 machine. > > Fix this by handling the SIGILL. Likewise in gdb.arch/powerpc- > lnia.exp. > > Tested on powerpc64le-linux. > > Any comments? This looks good to me. Thanks for cleaning these up. :-) Thanks -Will > > Thanks, > - Tom > > [gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases > > --- > gdb/testsuite/gdb.arch/powerpc-addpcis.exp | 14 +++++++++++++- > gdb/testsuite/gdb.arch/powerpc-lnia.exp | 14 +++++++++++++- > 2 files changed, 26 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp > b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp > index d1bc7f49ce6..ff7052ce475 100644 > --- a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp > +++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp > @@ -50,7 +50,19 @@ gdb_breakpoint $bp1 > gdb_breakpoint $bp2 > gdb_breakpoint $bp3 > > -gdb_test "stepi" "" "set r3 " > +set insn_supported 1 > +gdb_test_multiple "stepi" "set r3" { > + -re "Program received signal SIGILL, Illegal instruction\\..*" { > + set insn_supported 0 > + } > + -re -wrap "" { > + pass $gdb_test_name > + } > +} > +if { ! $insn_supported } { > + unsupported "illegal instruction" > + return > +} > set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] > gdb_test "stepi" "" "set r4" > set check_r4 [get_hexadecimal_valueof "\$r4" "default0"] > diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.exp > b/gdb/testsuite/gdb.arch/powerpc-lnia.exp > index 0f56d834046..4ab4f8d92be 100644 > --- a/gdb/testsuite/gdb.arch/powerpc-lnia.exp > +++ b/gdb/testsuite/gdb.arch/powerpc-lnia.exp > @@ -54,7 +54,19 @@ gdb_breakpoint $bp3 > > # single-step through the lnia instructions, and retrieve the > # register values as we proceed. > -gdb_test "stepi" "" "set r3" > +set insn_supported 1 > +gdb_test_multiple "stepi" "set r3" { > + -re "Program received signal SIGILL, Illegal instruction\\..*" { > + set insn_supported 0 > + } > + -re -wrap "" { > + pass $gdb_test_name > + } > +} > +if { ! $insn_supported } { > + unsupported "illegal instruction" > + return > +} > set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] > gdb_test "stepi" "" "set r4" > set check_r4 [get_hexadecimal_valueof "\$r4" "default0"]