From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com 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) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1678185961; bh=Ny/67nBvJg7YO7oV5x2P2GH6hbmusawNbQNYtje6b4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SwC1Km0+Q/7R1IJmPe1WFF7GRCrDqQBPeOM8JcucL2d3UTCkJHHts+T1CS/XOFj7w jP+J66VXE3B/aBhQ4rxaiCCKLCP0MqZFEn4HcMweW1z0rhk1bUO2rULMfq1mnjLvbE aau+NWzg637/cOyazzz33d8ziJYVjtw9grYSGLd9jehRdkv+uEWotKhK3leNzro2JQ M5yv5WpeItBghBKgBvUTNwxbw9JUvshxRgViZN1RXqEMpBcsL5Wpeef7IldskOLgOB aeIPy+Sy7QXFVNfxsFOZ9RBAO4hu7XE/M383J6/MgawsKjBrtD9YpAXkOJaQA+10Vm EAQ6y6xIy3XLw== Date: Tue, 7 Mar 2023 10:45:56 +0000 From: Lancelot SIX 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-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 >