From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 6438D3858D1E; Fri, 20 Jan 2023 17:05:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6438D3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674234357; bh=fWRODaaHLncsR6ZNU8ols4Tlq9BmQnh0e/hfBvSdvdo=; h=From:To:Subject:Date:From; b=UrOZBNP1pfn5TQBvUR4cd7Nruf5gii9+Gm2O76EN7hbx123WDkiFb4HBUxzKzAAke UAjBKJYHAO+gR0Iqi9vGMtlUzAwWYHaiFW+PCcDi88nHELHQRTMDPlsNhuAGQ8z6AR NDocLqYMbJmadsqqxtEJno65om5yjxhdYQjX6SQg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Make gdb.ada/ptype_tagged_param.exp pass X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: b70bff5ea52550c7cd48af7579a75ac2624ec13d X-Git-Newrev: 75890dfaf1f8de54271d2e048810c4bfd3edfe95 Message-Id: <20230120170557.6438D3858D1E@sourceware.org> Date: Fri, 20 Jan 2023 17:05:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D75890dfaf1f8= de54271d2e048810c4bfd3edfe95 commit 75890dfaf1f8de54271d2e048810c4bfd3edfe95 Author: Tom Tromey Date: Thu Jan 19 09:30:18 2023 -0700 Make gdb.ada/ptype_tagged_param.exp pass =20 gdb.ada/ptype_tagged_param.exp is failing for me on x86-64 Fedora 36. However, it's actually generating the correct output -- it is just that the test thinks that the "ptype" will not work because I do not have the GNAT debuginfo installed. =20 This patch changes the code to accept either result, and then to issue a kfail as appropriate. Diff: --- gdb/testsuite/gdb.ada/ptype_tagged_param.exp | 42 +++++++++++++++---------= ---- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp b/gdb/testsuite/g= db.ada/ptype_tagged_param.exp index 0050d60a0f2..eaf61ddde79 100644 --- a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp +++ b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp @@ -31,23 +31,27 @@ if {![runto "pck.adb:20"]} { return -1 } =20 -# Identifying the runtime type of S can only be done when we have the debug -# info for the GNAT runtime. - -if { $has_runtime_debug_info } { - gdb_test "ptype s" \ - [multi_line \ - "type =3D new pck.shape with record" \ - " r: integer;" \ - "end record"] \ - "ptype s, with debug info" -} else { - gdb_test "ptype s" \ - [multi_line \ - "type =3D tagged record" \ - " x: integer;" \ - " y: integer;" \ - "end record" ] \ - "ptype s, without debug info" +# With some versions of the compiler, identifying the runtime type of +# S can only be done when we have the debug info for the GNAT runtime. +set ordinary [multi_line \ + "type =3D new pck.shape with record" \ + " r: integer;" \ + "end record"] +set nodebug [multi_line \ + "type =3D tagged record" \ + " x: integer;" \ + " y: integer;" \ + "end record"] + +gdb_test_multiple "ptype s" "ptype s" { + -re -wrap $ordinary { + pass $gdb_test_name + } + -re -wrap $nodebug { + if {$has_runtime_debug_info} { + kfail "no debug info" $gdb_test_name + } else { + fail $gdb_test_name + } + } } -