public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>,
	Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value
Date: Tue, 7 Mar 2023 20:33:09 +0000	[thread overview]
Message-ID: <20230307203309.i75k6nlj4bh3axc6@ubuntu.lan> (raw)
In-Reply-To: <878rg8s70t.fsf@tromey.com>

On Tue, Mar 07, 2023 at 12:20:18PM -0700, Tom Tromey wrote:
> >>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> I think that Pedro hinted that we would need this anyway at some point,
> Simon> for functions that don't follow a defined ABI.  So, I think it would
> Simon> make sense, but we need to update the core of GDB to handle that
> Simon> response.
> 
> Can we even detect this situation?
> 
> E.g., PR 30090 turned out to have a function with a nonstandard ABI, and
> in the end I just xfail'd the test.
> 
> Simon> And I'm not too familiar with this area, so I don't know how
> Simon> much work this represents.  But if we know we're going to need this
> Simon> anyway, I might as well give it a shot.
> 
> There aren't many callers of the gdbarch hooks so I guess you could just
> track them all down and see what needs to be done at each one.  There's
> definitely already code to handle the lack of a return value, so it
> seems like it may not be too hard.

We already have some things in place to support cases when DWARF
indicates that a given function does not follow the standard calling
convention for the target (DW_AT_calling_convention set to
DW_CC_nocall).

We have discussed this a bit off-list, and our understanding is that the
gdbarch hook has to implement the standard ABI.  In the end, returning a
RETURN_VALUE_UNKNOWN value would imply that a gdbarch hook does not
implement the ABI for a given type.  The better approach would be to
finish the implementation to add support for such type, in which case
RETURN_VALUE_UNKNOWN is not needed.

I am not sure how we would model the ticket you linked above.  Could the
arch implement a "rust on $ARCH"  ABI in the gdbarch hook by inspecting
the language of the CU the function belongs to?  This would need the
custum ABI to be stable, and I have no idea if this is the case for
rust.

Lancelot.

> 
> Tom

  parent reply	other threads:[~2023-03-07 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 21:46 Simon Marchi
2023-03-07 10:45 ` Lancelot SIX
2023-03-07 14:47   ` Simon Marchi
2023-03-07 19:12     ` Lancelot SIX
2023-03-07 19:20     ` Tom Tromey
2023-03-07 20:32       ` Simon Marchi
2023-03-07 20:44         ` Tom Tromey
2023-03-07 20:33       ` Lancelot SIX [this message]
2023-03-07 20:44         ` Tom Tromey

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=20230307203309.i75k6nlj4bh3axc6@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).