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 275F4383581A for ; Wed, 11 May 2022 20:05:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 275F4383581A 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D9F5C1E00D; Wed, 11 May 2022 16:05:12 -0400 (EDT) Message-ID: <0a64fa6a-3a9f-7372-19ba-7a5430c05268@simark.ca> Date: Wed, 11 May 2022 16:05:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] gdb: Fix issue with Clang CLI macros Content-Language: en-US To: Bruno Larsen , gdb-patches@sourceware.org References: <20220420174111.220211-1-blarsen@redhat.com> <279a5be0-36a4-26d2-00f6-6f58e71d7187@simark.ca> <2af2c9aa-7562-aba6-a51d-ff73e65fa679@simark.ca> <36f6b154-7f52-c0ea-8f6f-bca9c534b8d5@redhat.com> From: Simon Marchi In-Reply-To: <36f6b154-7f52-c0ea-8f6f-bca9c534b8d5@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 11 May 2022 20:05:14 -0000 On 2022-05-11 16:03, Bruno Larsen via Gdb-patches wrote: > > On 5/11/22 15:48, Simon Marchi wrote: >> >> >> On 2022-05-11 10:53, Bruno Larsen via Gdb-patches wrote: >>> >>> On 5/11/22 09:59, Simon Marchi wrote: >>>> >>>> >>>> On 2022-04-20 13:41, Bruno Larsen via Gdb-patches wrote: >>>>> Clang up to the current version adds macros that were defined in the >>>>> command line or by "other means", according to the Dwarf specification, >>>>> after the last DW_MACRO_end_file, instead of before the first >>>>> DW_MACRO_start_file, as the specification dictates. This has been >>>>> submitted as a bug to Clang developers, but seeing as there is no >>>>> expected date for it to be fixed, a workaround was added for all current >>>>> versions of Clang. >>>>> >>>>> The workaround detects when the main file would be closed and if the >>>>> producer is clang, and turns that operation into a noop, so we keep a >>>>> reference to the current_file as those macros are read. >>>>> >>>>> This patch fixes PR macros/29034, and can be tested by running >>>>> gdb.base/macscp.exp using clang, the test printing FROM_COMMANDLINE >>>>> should be fixed. >>>> >>>> Hi Bruno, >>> >>> Hi Simon! >>> >>> Thanks for the review, I've fixed all minor comments locally and will send a v2 shortly. >>> >>>> >>>> Can we also add a DWARF-assembly-based test case, so that this is tested >>>> regardless of CC_FOR_TARGET? >>> >>> I can do that, but since I have a producer check and I want to specifically fix this clang bug, the test would want to see nothing happening on regular testing, and the macro showing up for clang. Is this what you had in mind? >> >> The test you produce could include the "clang" producer string. > > Right, yes, sorry, didn't think we could do that. > >> >>> >>> >>>> >>>> My series here adds some code to generate DWARF5 .debug_macro sections: >>>> >>>> https://sourceware.org/pipermail/gdb-patches/2022-April/188478.html >>>> > > Has this series been merged already? I've just pulled master and I couldn't find the code for macros in testsuite/lib/dwarf.exp No, I'm waiting for review :). Simon