From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mMyCCSQUMmHpCgAAWB0awg (envelope-from ) for ; Fri, 03 Sep 2021 08:25:08 -0400 Received: by simark.ca (Postfix, from userid 112) id 23F3E1EE22; Fri, 3 Sep 2021 08:25:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2B9791EDDB for ; Fri, 3 Sep 2021 08:25:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80296384BC11 for ; Fri, 3 Sep 2021 12:25:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80296384BC11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630671906; bh=zXFYa4c/Hgs/SIqYynenuY9jdvD9kqm96dkDlkWqfyM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nedqa4OHKjAjnYrlmhZCxzhaodzQBQOl4wkmKivw7Alx7hO35Z7QHkkHUMzsD4suK V5jKmArn4wyC8baKvOscMO85O2bBTF4eygEq7Ur94oBEG1BBWVctCTAdTMUYYq7VRd qW8l+yHMZ8/ygjN2l5dAZUjOOmiP3mYLa8IhWS24= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id A488C385840F for ; Fri, 3 Sep 2021 12:24:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A488C385840F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 183COh3b027972 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Sep 2021 08:24:47 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 183COh3b027972 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DC9621EDDB; Fri, 3 Sep 2021 08:24:42 -0400 (EDT) Subject: Re: [PATCH][gdb/testsuite] Add untested case in selftest_setup To: Tom de Vries , gdb-patches@sourceware.org References: <20210902061325.GA29918@delia> Message-ID: <89921d12-57b6-5fef-4adf-04ce9d3940e3@polymtl.ca> Date: Fri, 3 Sep 2021 08:24:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210902061325.GA29918@delia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 3 Sep 2021 12:24:43 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-09-02 2:13 a.m., Tom de Vries via Gdb-patches wrote: > Hi, > > When building gdb with "-Wall -O2 -g -flto=auto", I run into: > ... > FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \ > (got interactive prompt) > FAIL: gdb.gdb/python-helper.exp: run until breakpoint at captured_main > WARNING: Couldn't test self > ... > and similar in gdb.gdb/selftest.exp. > > The first FAIL in more detail: > ... > (gdb) break captured_main^M > Function "captured_main" not defined.^M > Make breakpoint pending on future shared library load? (y or [n]) n^M > (gdb) FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \ > (got interactive prompt) > ... > > The problem is that lto has optimized away the captured_main function > and consequently the selftests dependent on that cannot run. > > Fix this by: > - using gdb_breakpoint to detect failure to set the breakpoint > - handling the failure to set a breakpoint by calling untested > - not emitting the warning if we've already got untested > such that we have: > ... > (gdb) UNTESTED: gdb.gdb/python-helper.exp: Cannot set breakpoint at \ > captured_main, skipping testcase. > ... > > Any comments? I don't see what else we could do in this case, so LGTM. Simon