public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value
Date: Tue, 7 Mar 2023 10:45:56 +0000	[thread overview]
Message-ID: <20230307104556.6irap5z2epv7ppxq@ubuntu.lan> (raw)
In-Reply-To: <20230306214650.1744872-1-simon.marchi@polymtl.ca>

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.

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.

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.

Best,
Lancelot.

> +}
> +
>  /* Return the name of register REGNUM.  */
>  
>  static const char *
> @@ -1195,6 +1205,8 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
>  
>    set_gdbarch_dwarf2_reg_to_regnum (gdbarch, amdgpu_dwarf_reg_to_regnum);
>  
> +  set_gdbarch_return_value_as_value (gdbarch, amdgpu_return_value_as_value);
> +
>    /* Register representation.  */
>    set_gdbarch_register_name (gdbarch, amdgpu_register_name);
>    set_gdbarch_register_type (gdbarch, amdgpu_register_type);
> 
> base-commit: 1d6653fd3f4e0d7140e705733412fd75c40177b2
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-03-07 10:46 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 [this message]
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
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=20230307104556.6irap5z2epv7ppxq@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=gdb-patches@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).