From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4vCJJK6MB2S+qAcAWB0awg (envelope-from ) for ; Tue, 07 Mar 2023 14:12:46 -0500 Received: by simark.ca (Postfix, from userid 112) id 873951E223; Tue, 7 Mar 2023 14:12:46 -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=uy0T1zg+; 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 2E80E1E110 for ; Tue, 7 Mar 2023 14:12:46 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A21A9385800C for ; Tue, 7 Mar 2023 19:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A21A9385800C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678216364; bh=dLniCod46Cips8V9YjIbKDvkmoAkSn7pKYVOBnN0b3g=; 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=uy0T1zg+tMdzORBiJHJf1WJ7Hnuw48nooFVrhVT7XN7O21rd5t26tjrfNsRswf2Ou bzERlP68dEYp4efodgO9tI5b2SX01RYEfferPp/enfs2g3BBk5Tjko+J9mBIJZutNp GgMmOzZd91j2gcpoBMLa8tMB+O6HqNaiNKF6Pc/g= 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 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) Date: Tue, 7 Mar 2023 19:12:19 +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: <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-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" 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