[PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value

Lancelot SIX lsix@lancelotsix.com
Tue Mar 7 19:12:19 GMT 2023


On Tue, Mar 07, 2023 at 09:47:15AM -0500, Simon Marchi via Gdb-patches wrote:
> 
> 
> 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.
>

Hi,

Sorry I missed that, I am a bit behind on reading the ML.

> 
> Yes, that's my experience.  The AMD GPU port upstream is too barebones
> to use these commands.  And it's just temporary.

FWIW, this LGTM.

I have tested this and it solves the original issue you have seen.

Reviewed-By: Lancelot SIX <lancelot.six@amd.com>

Best,
Lancelot.

> 
> Simon


More information about the Gdb-patches mailing list