public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: Fix issue with Clang CLI macros
Date: Mon, 17 Oct 2022 15:35:52 +0200	[thread overview]
Message-ID: <f18e975a-3cdb-03c5-6033-eb166b051c2d@redhat.com> (raw)
In-Reply-To: <7ed10ff3-234e-5b47-bce4-ad1376f46603@simark.ca>


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
>


      reply	other threads:[~2022-10-17 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 10:26 Bruno Larsen
2022-10-17 12:32 ` Simon Marchi
2022-10-17 14:54   ` Bruno Larsen
2022-10-17 15:28     ` Simon Marchi
2022-10-17 13:22 ` Simon Marchi
2022-10-17 13:35   ` Bruno Larsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f18e975a-3cdb-03c5-6033-eb166b051c2d@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).