From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value
Date: Tue, 7 Mar 2023 09:47:15 -0500 [thread overview]
Message-ID: <5f905345-15a1-d7e0-f8b5-221997fcd1ac@polymtl.ca> (raw)
In-Reply-To: <20230307104556.6irap5z2epv7ppxq@ubuntu.lan>
On 3/7/23 05:45, Lancelot SIX wrote:
> Hi Simon,
>
>> +/* Dummy implementation of gdbarch_return_value_as_value. */
>> +
>> +static return_value_convention
>> +amdgpu_return_value_as_value (gdbarch *arch, value *function, type *valtype,
>> + regcache *regcache, value **read_value,
>> + const gdb_byte *writebuf)
>> +{
>> + gdb_assert_not_reached ("not implemented");
>
> Isn't "error" more appropriate here? We just need to indicate that the
> current hook failed. GDB is not in an inconsistent state.
In my original patch, I made these hooks optional, and added some
predicate checks:
if (!gdbarch_return_value_as_value_p (gdbarch))
error_arch_no_return_value (gdbarch);
The feedback was that throwing errors at some of these places (like
during event handling) would probably put GDB in a bad state. Erroring
out of amdgpu_return_value_as_value would be the same.
>
> Maybe another approach could be to add an elem to the
> return_value_convention like RETURN_VALUE_UNKNOWN which could be a
> reasonable default if the gdbarch does not know how to handle a given
> type.
I think that Pedro hinted that we would need this anyway at some point,
for functions that don't follow a defined ABI. So, I think it would
make sense, but we need to update the core of GDB to handle that
response. And I'm not too familiar with this area, so I don't know how
much work this represents. But if we know we're going to need this
anyway, I might as well give it a shot.
> Anyway, I do not think that you can easily reach this point with the
> current port of amdgcn. The `return`, `finish` and `call` commands will
> produce errors before reaching this point.
Yes, that's my experience. The AMD GPU port upstream is too barebones
to use these commands. And it's just temporary.
Simon
next prev parent reply other threads:[~2023-03-07 14:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 21:46 Simon Marchi via Gdb-patches
2023-03-07 10:45 ` Lancelot SIX via Gdb-patches
2023-03-07 14:47 ` Simon Marchi via Gdb-patches [this message]
2023-03-07 19:12 ` Lancelot SIX via Gdb-patches
2023-03-07 19:20 ` Tom Tromey
2023-03-07 20:32 ` Simon Marchi via Gdb-patches
2023-03-07 20:44 ` Tom Tromey
2023-03-07 20:33 ` Lancelot SIX via Gdb-patches
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=5f905345-15a1-d7e0-f8b5-221997fcd1ac@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=simon.marchi@polymtl.ca \
/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