From patchwork Thu Jan 19 16:31:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 63405 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B9053858024 for ; Thu, 19 Jan 2023 16:32:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B9053858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674145947; bh=c5y+zgo36q5hFuwbGUu0rUPxEeON0z36nusOty+TWEc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=xrKucY4WhGcagFEy4SxCmfCq7VOi6lqZYA+M8WH59QOT/k2KyGky/WxbdNumu0B0W s2+oxYf0FXyNiFBCYW72P7zpFcK+v+/FECi9XIsnB52AeJy0OSt8Vudhb2PZkiPTu2 GNTxPLlabZ1ZKQKbs1vrRFP7E8TDvS1qhU+Yx11Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 668EF385841E for ; Thu, 19 Jan 2023 16:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 668EF385841E Received: by mail-io1-xd30.google.com with SMTP id b127so1206089iof.8 for ; Thu, 19 Jan 2023 08:31:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c5y+zgo36q5hFuwbGUu0rUPxEeON0z36nusOty+TWEc=; b=vMZtxpPGtWh474pl8j2O01PlaEYQ5P0dJXA3gVG9j3s7QFjqOVEvveVyAtU+KLsaAG O0D6hHhf/h39b4eRgI73kAJJI2f3u/JUtpc+Moiekyype2D445SiiG7staendAQ2F1fs dVOVc6LT++FSZg1YNiz7FjOtqqJHe/K+9ESQoAqIbmagDpS0Q/hW6N/S3/tyqrIgeMHD n7ouuj07GYt+Bp11AlhayRntzvxkQxorX1nE6oP4GyYV4L4l1LgCkGtk4crHH/jpyPEF OVN3ceckqeA6DrcHMIO1MSmsjxk1XqRQOhvIfWAhAGmTmx7nHJeIL8tVDiu32d8IAneS mBxg== X-Gm-Message-State: AFqh2krrxzh3lPCys3WYZXTBeSnv63OwYsakqxPyJoBFNDLP2ZnzmEWs Zwk0/1Pk2Hf2K2sZifMfavG+H0dmWZtmaAWA X-Google-Smtp-Source: AMrXdXs10JrLhMUnLqLWiO/xiMM8rWPQJdt5EkcxDYAEWQJFMdRSRmGPH/yFnoDikmiUNwWTUFUVlQ== X-Received: by 2002:a6b:e206:0:b0:6ea:558f:6e4b with SMTP id z6-20020a6be206000000b006ea558f6e4bmr8363514ioc.19.1674145917564; Thu, 19 Jan 2023 08:31:57 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id b20-20020a5d8914000000b006d8b7bcaa6esm12537905ion.4.2023.01.19.08.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 08:31:57 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Make gdb.ada/ptype_tagged_param.exp pass Date: Thu, 19 Jan 2023 09:31:50 -0700 Message-Id: <20230119163150.492922-1-tromey@adacore.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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. This patch changes the code to accept either result, and then to issue a kfail as appropriate. --- 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/gdb.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 } -# 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 = new pck.shape with record" \ - " r: integer;" \ - "end record"] \ - "ptype s, with debug info" -} else { - gdb_test "ptype s" \ - [multi_line \ - "type = 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 = new pck.shape with record" \ + " r: integer;" \ + "end record"] +set nodebug [multi_line \ + "type = 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 + } + } } -