From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 89D5D38582A1 for ; Thu, 28 Jul 2022 15:33:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89D5D38582A1 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 28E7E1E87E; Thu, 28 Jul 2022 11:33:02 -0400 (EDT) Message-ID: Date: Thu, 28 Jul 2022 11:33:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] gdb: call check_typedef at beginning of dwarf_expr_context::fetch_result Content-Language: fr To: Lancelot SIX , Simon Marchi Cc: gdb-patches@sourceware.org References: <20220728013422.2561677-1-simon.marchi@efficios.com> <20220728085607.hicavv2k2tg4jfew@octopus> From: Simon Marchi In-Reply-To: <20220728085607.hicavv2k2tg4jfew@octopus> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, 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-List-Received-Date: Thu, 28 Jul 2022 15:33:03 -0000 On 7/28/22 04:56, Lancelot SIX via Gdb-patches wrote: > Hi, > > [...] >> diff --git a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp >> new file mode 100644 >> index 00000000000..3a3740234fa >> --- /dev/null >> +++ b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp >> @@ -0,0 +1,36 @@ >> +# Copyright 2022 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +# The program associated to this test case uncovered a bug in GDB (PR 29374) >> +# where a typedef type was used before it was resolved. >> + >> +standard_testfile .S > > Shouldn’t there be something like: > > if { ![istarget x86_64-*-linux* ] } { > return > } > > or similar to make sure that we do not try to compile this .S file on > incompatible archs? Good idea. I assumed the gdb_compile would fail and make us skip the test on incompatible architectures, but it spews a lot of errors, so it's cleaner to filter ahead on the arch. I tested this on an aarch64 machine, and then thought I could add a version of the .S for aarch64, on which I could reproduce the bug too, so the v3 includes that. Simon