From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 18D383972839 for ; Wed, 10 Mar 2021 17:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18D383972839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id BD4281163D1; Wed, 10 Mar 2021 12:56:14 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MkVRkCh4T0j8; Wed, 10 Mar 2021 12:56:14 -0500 (EST) Received: from murgatroyd.Home (71-211-165-100.hlrn.qwest.net [71.211.165.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 786AA1163C8; Wed, 10 Mar 2021 12:56:14 -0500 (EST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/5] Fix regression in Ada ptype Date: Wed, 10 Mar 2021 10:56:10 -0700 Message-Id: <20210310175612.1759272-4-tromey@adacore.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310175612.1759272-1-tromey@adacore.com> References: <20210310175612.1759272-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 10 Mar 2021 17:56:16 -0000 This fixes PR ada/27545, which points out that a test in gdb.ada/tagged.exp started failing due to the expression rewrite. I didn't notice this failure because my system gcc-gnat debuginfo was out of date, and so the test was already failing in the baseline. Previously, the OP_VAR_VALUE case in ada_evaluate_subexp ended up doing a recursive call: arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL); However, during the rewrite I missed this fact and had the new code call the superclass implementation. This patch fixes the bug by changing this code to use a recursive call instead. gdb/ChangeLog 2021-03-10 Tom Tromey PR ada/27545: * ada-lang.c (ada_var_value_operation::evaluate): Use recursive call for tagged type. --- gdb/ChangeLog | 6 ++++++ gdb/ada-lang.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 7e53ae07c18..38f4ec0452b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10320,8 +10320,7 @@ ada_var_value_operation::evaluate (struct type *expect_type, a fixed type would result in the loss of that type name, thus preventing us from printing the name of the ancestor type in the type description. */ - value *arg1 = var_value_operation::evaluate (nullptr, exp, - EVAL_NORMAL); + value *arg1 = evaluate (nullptr, exp, EVAL_NORMAL); if (type->code () != TYPE_CODE_REF) { -- 2.26.2