public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] [gdb/tdep] Assume epilogue unwind info is valid unless gcc < 4.5.0
Date: Mon, 13 Feb 2023 15:24:58 +0100	[thread overview]
Message-ID: <a13ee144-54d2-d456-f191-0a8abe3a1e6d@suse.de> (raw)
In-Reply-To: <5d5eeb5d-bc39-c01f-53e8-d961ed0b98ea@suse.de>

On 1/27/23 22:13, Tom de Vries via Gdb-patches wrote:
> On 1/21/23 18:48, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries via Gdb-patches 
>>>>>>> <gdb-patches@sourceware.org> writes:
>>
>> Tom> Fix these two issues by reversing the burden of proof:
>> Tom> - currently we assume epilogue unwind info is invalid unless we 
>> can proof that
>> Tom>   gcc >= 4.5.0.
>> Tom> - instead, assume epilogue unwind info is valid unless we can 
>> proof that
>> Tom>   gcc < 4.5.0.
>>
>> FWIW this approach makes sense to me.
>>
> 
> OK, then changing RFC -> PATCH.
> 
>> It's pretty lame that there's no way to detect this failure from the
>> frame section -- it can't be producer-sniffed and the augmentation
>> strings can't really be changed.
>>
>> gcc 4.5 was released in 2010, and so it's not like we're inconveniencing
>> a lot of users.  If needed I guess we could add a user setting to switch
>> this behavior back on.
>>
>> Note there is a similar issue for the prologue, see:
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=25696
>> https://sourceware.org/bugzilla/show_bug.cgi?id=17265
>> https://sourceware.org/bugzilla/show_bug.cgi?id=21470
>>
>> Also worth seeing the hilarious:
>>
>> https://github.com/rust-lang/rust/issues/41252#issuecomment-293676579
>>
>> I think that in this area we should assume the debug info is correct,
>> and keep a list of known-bad producers rather than assuming the debug
>> info is wrong and having a list of known-good ones.
>>
>> Tom> +  if (/* In absence of producer information, optimistically 
>> assume that we're
>> Tom> +     not dealing with gcc < 4.5.0.  */
>>
>> This placement of the comment is pretty weird, it seems fine to just
>> stick it before the 'if'.
>>
> 
> Done.
> 
>> Tom> +      if (cu->producer == nullptr)
>> Tom> +    /* In absence of producer information, optimistically assume 
>> that we're
>> Tom> +       not dealing with gcc < 4.5.0.  */
>> Tom> +    cust->set_epilogue_unwind_valid (true);
>> Tom> +      if (!producer_is_gcc (cu->producer, nullptr, nullptr))
>>
>> Normally if there is a comment and a line of code as the consequence of
>> an 'if', we put them both in a block.
>>
> 
> Done.
> 
>> Anyway I was also thinking that the second one should say 'else if'.
> 
> True, thanks for catching that, also done.
> 
> I've also added a test-case, for the amd64-tdep.c change. I could make 
> another one for the i386-tdep.c change, and/or one for the dwarf/read.c 
> change, but I'm not sure that's worth the trouble.
> 

Posted v2 here: 
https://sourceware.org/pipermail/gdb-patches/2023-February/197011.html

Thanks,
- Tom

      reply	other threads:[~2023-02-13 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21  7:48 [RFC] " Tom de Vries
2023-01-21 17:48 ` Tom Tromey
2023-01-27 21:13   ` [PATCH] " Tom de Vries
2023-02-13 14:24     ` Tom de Vries [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=a13ee144-54d2-d456-f191-0a8abe3a1e6d@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).