From: Tom de Vries <tdevries@suse.de>
To: Kevin Buettner <kevinb@redhat.com>, Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] [gdb/exp] Fix cast handling for indirection
Date: Mon, 6 May 2024 08:52:16 +0200 [thread overview]
Message-ID: <959884bf-9cae-46c1-ba2e-4d62f3c77385@suse.de> (raw)
In-Reply-To: <20240505175439.4a1c3317@f40-zbm-amd>
On 5/6/24 02:54, Kevin Buettner wrote:
> On Sat, 4 May 2024 00:26:49 +0100
> Pedro Alves <pedro@palves.net> wrote:
>
>> I kind of emphasized the sign extension part above, but to be clear, with
>>
>> (gdb) p (long long)*a_loc()
>>
>> and gdb assuming that means a_loc returns "long long *", gdb incorrectly reads a
>> 64-bit value off of the pointer address, which is totally bogus and would not
>> be what gdb would do if it had debug info for a_loc(), in which case GDB would
>> know that it returns char *, and thus would deref only one byte and behave like
>> described above in the 1: 2: 3: steps. The behavior of the expression should not
>> change like that depending on whether you have debug info. Thus, GDB should error
>> out.
>
> This argument is compelling. You've convinced me.
>
And me as wel.
I've submitted a patch
(https://sourceware.org/pipermail/gdb-patches/2024-May/208843.html ) to
redo the fix.
Thanks,
- Tom
prev parent reply other threads:[~2024-05-06 6:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 15:49 Tom de Vries
2024-05-03 2:31 ` Kevin Buettner
2024-05-03 7:37 ` Tom de Vries
2024-05-03 15:27 ` Tom Tromey
2024-05-03 16:04 ` Pedro Alves
2024-05-03 17:30 ` Kevin Buettner
2024-05-03 23:17 ` Pedro Alves
2024-05-03 23:26 ` Pedro Alves
2024-05-06 0:54 ` Kevin Buettner
2024-05-06 6:52 ` 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=959884bf-9cae-46c1-ba2e-4d62f3c77385@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
--cc=pedro@palves.net \
--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