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 8D4B03858D32 for ; Mon, 17 Oct 2022 13:35:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D4B03858D32 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-576-2tQsjYGbMjisrKtz2HdkZg-1; Mon, 17 Oct 2022 09:35:55 -0400 X-MC-Unique: 2tQsjYGbMjisrKtz2HdkZg-1 Received: by mail-ed1-f70.google.com with SMTP id h13-20020a056402280d00b0045cb282161cso9477800ede.8 for ; Mon, 17 Oct 2022 06:35:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/v5Zf0pGzDo//JNUlDmyHXsEEfZx+ju6HyWEh45CBnQ=; b=ym8VMjXnwmNfjrzSgCsSycPX0mY6ut0fDI1b983MzEWBgWVzSq2+zmpmpNafh5YeQB sKBe91r09iWls2bu6pOezNHQAyfJZ1KW7LdRXsPZt0hshdKughvKUq6hQJwNk1fbWGJv UY/9g8OxyEZUhZZCgmivvUUTkQGSO8teRBQrw5+1l8n6n9kfdueGJdszvMrDZ4yUWu0z cP8MtIaaotMVGt9LZdMTwj4k9iav4mWFjwvwpF0Bkl8sBZ6hsntwtoB1YEbvJzkDrzGq 8GtSaoE3n9IMOA22UHI0zpUrX1ilv5A+lLIcXD1F+vpHyx06sUyu6WTProgYml8uFfeH XNJQ== X-Gm-Message-State: ACrzQf3ix6vy89g9Dfeu9tPoDstGguHj4MRaa5pLEuyHpBk9zA84obkO +tcAsiWHmFCktjil8IKf+at2yJDRHMgLxvTVxQP3Pk2TP8km9PIPmQZFU4V2CuCQ7DskYi+A4nj YWhjgfAk1DizNSsTN1AmuWA== X-Received: by 2002:a17:907:96a0:b0:78d:dd45:a6d4 with SMTP id hd32-20020a17090796a000b0078ddd45a6d4mr8868799ejc.643.1666013753973; Mon, 17 Oct 2022 06:35:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Hqv9NrJeFOKjRNQYKdOrHbljZ7jtuCp64+PB1imxdDnbhRb40C2S+u3GJdOf9Pb8dnddTMQ== X-Received: by 2002:a17:907:96a0:b0:78d:dd45:a6d4 with SMTP id hd32-20020a17090796a000b0078ddd45a6d4mr8868786ejc.643.1666013753732; Mon, 17 Oct 2022 06:35:53 -0700 (PDT) Received: from [10.43.2.105] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id vj23-20020a170907131700b00782e3cf7277sm5987786ejb.120.2022.10.17.06.35.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 06:35:53 -0700 (PDT) Message-ID: Date: Mon, 17 Oct 2022 15:35:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v2] gdb: Fix issue with Clang CLI macros To: Simon Marchi , gdb-patches@sourceware.org References: <20221017102627.2540273-1-blarsen@redhat.com> <7ed10ff3-234e-5b47-bce4-ad1376f46603@simark.ca> From: Bruno Larsen In-Reply-To: <7ed10ff3-234e-5b47-bce4-ad1376f46603@simark.ca> 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=-6.5 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_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: Mon, 17 Oct 2022 13:35:59 -0000 On 17/10/2022 15:22, Simon Marchi wrote: > > On 2022-10-17 06:26, 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. When GDB reads the >> macros after the last file is closed, the macros never end up "in scope" >> and so we can't print them. This has been submitted as a bug to Clang >> developers, and PR macros/29034 was opened for GDB to keep track of >> this. >> >> 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. >> >> A test case was added to confirm the functionality. >> >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29034 > I forgot to mention, should this setup_kfail be removed? > > https://gitlab.com/gnutools/binutils-gdb/-/blob/e57f7fa070e16683c0e1ddd0d1307d243fad990d/gdb/testsuite/gdb.base/macro-source-path.exp#L68 Good catch! yeah, it should be removed, I'll add it in my next version. Cheers, Bruno > > Simon >