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 ED1573858C2C for ; Tue, 7 Mar 2023 19:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED1573858C2C 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 2A8E28739B; Tue, 7 Mar 2023 19:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1678216344; bh=t/giavKIwvNVIP7GXyRzEOF0+fyjGg8P4g9EZWdmAvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S0gnqG7x8MbeMyeJPa1XSeA6ZnkpWkJ9+paM3G5UbNZSEqtWgtXwhJB4/9b0S5Rn+ ouGaEylwNyCtGd3gBbbbeyHtCES4xxUEmcmYh7u4VGX+silQ+W8gqhpTzDm+lg9Zdw f5/wgjaC+PA3KBbqrVCLdXiy+cm2znRDEC9kkKk29dCSYvjCKxbVjw8t13jzO5kALu 77wYfMta8jNKSqNoZuDVn/bOqMw4pKed35r6WB0CaEzs3eFDsVWOR4Gars4VY/WH4F rFgPRvtOc9jWw7GtyfPO8NfTtgkTC7D2Y2PB/RPXa/PkoH3brP5VBUP6+QHRXSn4dE Rk5XT6jnEAvUg== Date: Tue, 7 Mar 2023 19:12:19 +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: <20230307191207.jz6462fjgta7nkxc@ubuntu.lan> References: <20230306214650.1744872-1-simon.marchi@polymtl.ca> <20230307104556.6irap5z2epv7ppxq@ubuntu.lan> <5f905345-15a1-d7e0-f8b5-221997fcd1ac@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f905345-15a1-d7e0-f8b5-221997fcd1ac@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 19:12:24 +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: 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 Best, Lancelot. > > Simon