From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 793853839C71 for ; Wed, 11 May 2022 20:03:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 793853839C71 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632-24hP39goO0Km6RvhnbhfGQ-1; Wed, 11 May 2022 16:03:31 -0400 X-MC-Unique: 24hP39goO0Km6RvhnbhfGQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A9E701C3E982; Wed, 11 May 2022 20:03:30 +0000 (UTC) Received: from [10.97.116.38] (ovpn-116-38.gru2.redhat.com [10.97.116.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 117E62166B2F; Wed, 11 May 2022 20:03:29 +0000 (UTC) Message-ID: <36f6b154-7f52-c0ea-8f6f-bca9c534b8d5@redhat.com> Date: Wed, 11 May 2022 17:03:26 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] gdb: Fix issue with Clang CLI macros To: Simon Marchi , 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> From: Bruno Larsen In-Reply-To: <2af2c9aa-7562-aba6-a51d-ff73e65fa679@simark.ca> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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:03:35 -0000 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 Cheers! Bruno Larsen