Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
To: Keith Seitz <keiths@redhat.com>, Tom Tromey <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v4] infcall: Add support for integer literals as reference function paramters
Date: Mon, 2 Feb 2026 17:22:37 +0000	[thread overview]
Message-ID: <DM4PR11MB7303EE3B6B1869546CFC05A5C49AA@DM4PR11MB7303.namprd11.prod.outlook.com> (raw)
In-Reply-To: <49b0d193-6421-493b-9633-eedd473d110f@redhat.com>

On Monday, February 2, 2026 5:58 PM, Keith Seitz wrote:
> On 1/30/26 12:59 PM, Tom Tromey wrote:
> >>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
> >
> > Keith> - Allocate to stack instead of heap
> >
> > I'm curious why this change was made.
> > Often I think gdb just coerces to memory via malloc.
> 
> I was persuaded by another reviewer's comments[1]:

I'm sorry :/
 
>  > This uses malloc to allocate the space.  I was wondering if
> allocating
>  > space on the stack wouldn't be better.  That's how arguments that are
>  > implicitly pass-by-reference are passed.  Also struct return values
>  > are forced to lval in stack-allocated memory.
>  >
>  > Furthermore, malloc would not be possible everywhere (e.g. on GPUs);
>  > stack allocation would be supported by more platforms.
> 
> I was unable to conceive of a counterpoint to this last argument,
> hence the change.

To make this work for GPUs, we can delegate space allocation to
a gdbarch method, while defining the current malloc-based behavior
as the default hook.  Architectures that cannot use malloc can
handle the request their way.  If they are not able to make
the allocation, an error may be returned, which is not worse than
the state before your change.

For example, Intel's downstream debugger would be able to allocate
some space in an area in GPU that is specifically reserved for
debugger's use.

Regards
-Baris


Intel Deutschland GmbH
Registered Address: Dornacher Straße 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht München HRB 186928

  reply	other threads:[~2026-02-02 17:23 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
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 [this message]
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=DM4PR11MB7303EE3B6B1869546CFC05A5C49AA@DM4PR11MB7303.namprd11.prod.outlook.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --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