From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH][gdb/symtab] Fix unhandled dwarf expression opcode with gcc-11 -gdwarf-5
Date: Mon, 26 Jul 2021 11:55:43 -0400 [thread overview]
Message-ID: <14e9a2b9-23e9-c57a-41c0-75734ce0cb4a@polymtl.ca> (raw)
In-Reply-To: <3aab540b-f859-4310-a802-5416e3603282@suse.de>
On 2021-07-26 10:41 a.m., Tom de Vries wrote:
>> However, this high bounds value stored as a location expression won't be
>> very useful anyway. In most places (see get_discrete_high_bound), we
>> just return 0 if the property is not constant. But we did evaluate it,
>> the current interfaces that evaluate dynamic properties return CORE_ADDR
>> or LONGEST, all 64-bit values, so we could not return that value. So if
>> the property that you create was ever evaluated, it wouldn't yield a
>> valid result anyway. I quickly tried to find a way to make GDB evaluate
>> it to see what happens, but couldn't find one.
>>
>> If we ever want such a large high bound value to be useful, I think that
>> some interfaces and some code would need to be converted to use
>> arbitrary precision integers (using GMP maybe). And then
>> dynamic_prop_data::const_val could be a GMP type instead of a LONGEST,
>> allowing it to store that 16 bytes value. In which case we would
>> probably undo your patch here, because, if we can store the 16-byte
>> value as a constant directly, there's no need to convert it to a
>> location expression.
>>
>
> Yes, if we'd address PR20991 then this patch might be reverted. I don't
> see that as a problem.
>
> What I see as a problem is that we currently give the user the confusing
> "Unhandled dwarf expression opcode 0xff" which suggests either:
> - there's a compiler problem, or
> - gdb needs to handle the dwarf expression opcode 0xff,
> and neither is correct.
>
> With this patch, we give:
> ...
> That operation is not available on integers of more than 8 bytes.
> ...
> which points nicely to PR20991.
I agree with the user-visible behavior / change, so even though the
implementation does not look pretty, I can live with it.
Simon
prev parent reply other threads:[~2021-07-26 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-25 7:22 Tom de Vries
2021-07-26 13:49 ` Simon Marchi via Gdb-patches
2021-07-26 14:41 ` Tom de Vries
2021-07-26 15:55 ` Simon Marchi via Gdb-patches [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=14e9a2b9-23e9-c57a-41c0-75734ce0cb4a@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tdevries@suse.de \
--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