From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id auQQHf8VB2RiQgcAWB0awg (envelope-from ) for ; Tue, 07 Mar 2023 05:46:23 -0500 Received: by simark.ca (Postfix, from userid 112) id 6B49E1E223; Tue, 7 Mar 2023 05:46:23 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Lmo/Kp3I; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0F64D1E128 for ; Tue, 7 Mar 2023 05:46:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BB4C3858C66 for ; Tue, 7 Mar 2023 10:46:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BB4C3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678185982; bh=aUyIjD/2nnAd3Dj/7c3fDR+F+wdfXiHYfEOit4jeMvk=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Lmo/Kp3InXh94QwGQo+djxTXjOp0kz8ylo/hE8tR8JoyIp6+NfGCKuBS0bcGPm7Mr oCezvsYWKUO51aR9CScw97GGgLx6iCAGNNat2FPoWAFKLciHyk21uLdaNMvUuwVLOp bjBiQZCYaUKW6XUGOid159rJqciy2y3GTnDS4wyo= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 857013858D3C for ; Tue, 7 Mar 2023 10:46:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 857013858D3C Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 39FEF807C3; Tue, 7 Mar 2023 10:46:01 +0000 (UTC) Date: Tue, 7 Mar 2023 10:45:56 +0000 To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value Message-ID: <20230307104556.6irap5z2epv7ppxq@ubuntu.lan> References: <20230306214650.1744872-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230306214650.1744872-1-simon.marchi@polymtl.ca> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Tue, 07 Mar 2023 10:46:01 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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 >