public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	Simon Marchi <simon.marchi@efficios.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: work around negative DW_AT_data_member_location GCC 11 bug
Date: Wed, 26 Jan 2022 12:18:31 -0800	[thread overview]
Message-ID: <a33d94be-0dea-6442-00e1-8f1c33e7d981@redhat.com> (raw)
In-Reply-To: <e9b21bdc-6673-b659-a02e-a5a792996c56@polymtl.ca>

On 1/26/22 11:34, Simon Marchi wrote:
> 
> In this case, we want to handle a very specific known bug by a specific
> compiler.  We know that GCC meant 0 and not -1.  But I wouldn't turn any
> negative value into 0, because that might not be the value the compiler
> intended.  For example, another compiler could put -4 when it meant 4.
> If we turned that into 0, we would just add to the confusion.
> 
> In fact, I am tempted to add a producer check and only apply the fixup
> if the producer is gcc 11.
> 
> Since GDB doesn't know how to handle negative data member offsets (if
> that's even possible), I think that if we encounter a negative offset
> (other than the case above), we should just emit a complaint and leave
> the field's location as unknown.

All fair points; thank you for the explanation.

Keith


  parent reply	other threads:[~2022-01-26 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 15:37 Simon Marchi
2022-01-26 17:45 ` Simon Marchi
2022-01-26 18:17   ` Keith Seitz
2022-01-26 18:30     ` Keith Seitz
2022-01-26 19:34       ` Simon Marchi
2022-01-26 19:38         ` Kevin Buettner
2022-01-26 19:40           ` Simon Marchi
2022-01-26 20:18         ` Keith Seitz [this message]
2022-01-26 19:18     ` Simon Marchi
2022-01-26 20:23       ` Keith Seitz
2022-01-26 19:49 ` Bruno Larsen
2022-01-26 19:58   ` Simon Marchi

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=a33d94be-0dea-6442-00e1-8f1c33e7d981@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=simon.marchi@polymtl.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).