Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  Keith Seitz <keiths@redhat.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH v2] infcall: Add support for integer literals as reference function paramters
Date: Wed, 22 Oct 2025 07:21:42 -0600	[thread overview]
Message-ID: <87sefbkr6h.fsf@tromey.com> (raw)
In-Reply-To: <87qzuvcfb1.fsf@redhat.com> (Andrew Burgess's message of "Wed, 22 Oct 2025 13:05:22 +0100")

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

>> I don't know if that property (trivially-copyable) is all that easy to
>> detect in gdb, but if it is, I guess it would make sense to detect it
>> and throw an exception.  Since in that case we'd be looking at something
>> like a callee that wants memory but where the object has been SROA'd or
>> something along those lines.

Andrew> We have `language_pass_by_reference`, the return value of which will, I
Andrew> think, tell you if a type is trivially-copyable or not.  I don't think
Andrew> this is going to be the common path though; don't objects that are not
Andrew> trivially-copyable have to live in memory?  I'm sure there might be some
Andrew> edge case here, but for me, I'd be happy with a patch that ignores this
Andrew> for now, and we can come back to this later if/when we find a
Andrew> problematic case.

Yeah, that seems sensible.

I don't really know if compilers are capable of doing weird stuff like
scalar replacement of a non-trivially-destructible object combined with
inlining of the destructor the avoid needing the object in one piece.

Tom

  reply	other threads:[~2025-10-22 13:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 15:48 [PATCH] " 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 [this message]
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
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=87sefbkr6h.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.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