From: Keith Seitz <keiths@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH v5] infcall: Add support for integer literals as reference function parameters
Date: Thu, 12 Mar 2026 09:45:23 -0700 [thread overview]
Message-ID: <94042716-41c6-40e4-8064-680aecb9db20@redhat.com> (raw)
In-Reply-To: <f65f5b83-38d1-439a-afe3-444f5aa8d3c0@suse.de>
Hi,
On 3/12/26 9:23 AM, Tom de Vries wrote:
> On 3/12/26 3:14 PM, Keith Seitz wrote:
>> This is v5 of my attempt to add simple integer literal support for
>> refernece
>
> Hi Keith,
>
> refernece -> reference
Wowser. I'm blaming a lack of caffeine on all of this.
Please ignore this revision -- I will repost with all the typos fixed.
[And I noticed I forgot to revert some additional changes to
value_arg_coerce...]
> Also, I applied the test-case from this patch ( https://sourceware.org/
> pipermail/gdb-patches/2024-November/213340.html ) and confirmed that it
> also passes with this patch.
>
> I'm not sure if that means that you can claim the corresponding PR as
> well, or if it means that the test-case I wrote was not representive of
> the PR.
I am sorry I completely missed that. We seem to have come to two
different solutions. I will investigate and follow-up in my v6 repost.
>
>> how a user (or their program) handles any of these values.
>>
>> Keith
>>
>> Changes in v5
>> - Return to heap allocation
>>
>> Changes in v4
>> - Allocate to stack instead of heap
>> - Use value::force_lval to simply copying to inferior memory
>> - Add some addition tests
>>
>> Changes in v3
>> - Move logic to value_arg_coerce
>> - Add some attempt to limit copying to trivially copyable types
>>
>> -----
>>
>> This patch attempts to mitigate the shortcomings of passing literals
>> to inferior function calls requiring references. The specific use
>> case here
>> is std::map's operator[]:
>>
>> std::map int_map<int, int>;
>> int_map[1] = 10;
>> (gdb) print int_map[1]
>> Attempt to take address of value not located in memory.
>>
>> This is occurring because while value_coerce_to_target understands
>> that some values need to be allocated and copied to the inferior's
>> memory, it only considers the actual parsed type of the argument value,
>> ignoring the actual type of the function parameter. That is,
>
>> Changes in v5
>> - After reconsideration, return to heap allocation
>>
>> Changes in v4
>> - Allocate to stack instead of heap
>> - Use value::force_lval to simply copying to inferior memory
>> - Add some addition tests
>>
>> Changes in v3
>> - Move logic to value_arg_coerce
>> - Add some attempt to limit copying to trivially copyable types
>
> Is this a pasto? The list seems to be in the middle of some text.
<cough>It certainly is.</cough>
Thank you for taking a look!
Keith
next prev parent reply other threads:[~2026-03-12 16:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 15:48 [PATCH] infcall: Add support for integer literals as reference function paramters Keith Seitz
2025-10-17 14:49 ` Tom Tromey
2025-10-20 19:00 ` Keith Seitz
2025-10-20 19:36 ` [PATCH v2] " Keith Seitz
2025-10-21 20:19 ` Tom Tromey
2025-10-22 12:05 ` Andrew Burgess
2025-10-22 13:21 ` Tom Tromey
2026-01-22 19:05 ` Keith Seitz
2026-01-23 14:07 ` Aktemur, Tankut Baris
2026-01-27 18:43 ` Keith Seitz
2026-01-27 19:01 ` [PATCH v4] " Keith Seitz
2026-01-28 8:24 ` Aktemur, Tankut Baris
2026-01-28 13:54 ` Andrew Burgess
2026-02-02 17:05 ` Aktemur, Tankut Baris
2026-02-02 17:21 ` Keith Seitz
2026-01-30 20:59 ` Tom Tromey
2026-02-02 16:58 ` Keith Seitz
2026-02-02 17:22 ` Aktemur, Tankut Baris
2026-02-12 16:31 ` Tom Tromey
2026-03-12 14:14 ` [PATCH v5] infcall: Add support for integer literals as reference function parameters Keith Seitz
2026-03-12 16:23 ` Tom de Vries
2026-03-12 16:45 ` Keith Seitz [this message]
2026-03-12 17:12 ` [PATCH v6] " Keith Seitz
2026-03-17 14:10 ` Andrew Burgess
2026-03-17 18:11 ` Keith Seitz
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=94042716-41c6-40e4-8064-680aecb9db20@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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