From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MEVVCKKfB2TJvwcAWB0awg (envelope-from ) for ; Tue, 07 Mar 2023 15:33:38 -0500 Received: by simark.ca (Postfix, from userid 112) id 1D10B1E223; Tue, 7 Mar 2023 15:33:38 -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=eFIyn06a; 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=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 000951E128 for ; Tue, 7 Mar 2023 15:33:36 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97BFA3854839 for ; Tue, 7 Mar 2023 20:33:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97BFA3854839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678221215; bh=3+U9UNqOyc3oQ8+b6oqIFPzirrTA1p6WfIIZgO1aLdE=; 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=eFIyn06aCAxNjeHJIORPx5arj6rfzwJ58IU0GF3uRaHv3Cb3+RlA8BIbFLfWSb3kb kmb1nT0EixRN+eFPLBXb8ObCWLo+mhTA1b6qCOFq6Fvye/0FiVWxBtSG4JE8y/8wou uE8CAjUuyVTTl2dCFa6KLOKxR1O1oyoniCkvR2/w= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 9031D3858C2C for ; Tue, 7 Mar 2023 20:33:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9031D3858C2C Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 08BCE8739B; Tue, 7 Mar 2023 20:33:14 +0000 (UTC) Date: Tue, 7 Mar 2023 20:33:09 +0000 To: Tom Tromey Cc: Simon Marchi via Gdb-patches , Simon Marchi Subject: Re: [PATCH] gdb/amdgpu: provide dummy implementation of gdbarch_return_value_as_value Message-ID: <20230307203309.i75k6nlj4bh3axc6@ubuntu.lan> References: <20230306214650.1744872-1-simon.marchi@polymtl.ca> <20230307104556.6irap5z2epv7ppxq@ubuntu.lan> <5f905345-15a1-d7e0-f8b5-221997fcd1ac@polymtl.ca> <878rg8s70t.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878rg8s70t.fsf@tromey.com> 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 20:33:14 +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 12:20:18PM -0700, Tom Tromey wrote: > >>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> I think that Pedro hinted that we would need this anyway at some point, > Simon> for functions that don't follow a defined ABI. So, I think it would > Simon> make sense, but we need to update the core of GDB to handle that > Simon> response. > > Can we even detect this situation? > > E.g., PR 30090 turned out to have a function with a nonstandard ABI, and > in the end I just xfail'd the test. > > Simon> And I'm not too familiar with this area, so I don't know how > Simon> much work this represents. But if we know we're going to need this > Simon> anyway, I might as well give it a shot. > > There aren't many callers of the gdbarch hooks so I guess you could just > track them all down and see what needs to be done at each one. There's > definitely already code to handle the lack of a return value, so it > seems like it may not be too hard. We already have some things in place to support cases when DWARF indicates that a given function does not follow the standard calling convention for the target (DW_AT_calling_convention set to DW_CC_nocall). We have discussed this a bit off-list, and our understanding is that the gdbarch hook has to implement the standard ABI. In the end, returning a RETURN_VALUE_UNKNOWN value would imply that a gdbarch hook does not implement the ABI for a given type. The better approach would be to finish the implementation to add support for such type, in which case RETURN_VALUE_UNKNOWN is not needed. I am not sure how we would model the ticket you linked above. Could the arch implement a "rust on $ARCH" ABI in the gdbarch hook by inspecting the language of the CU the function belongs to? This would need the custum ABI to be stable, and I have no idea if this is the case for rust. Lancelot. > > Tom