From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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 08BCE8739B; Tue, 7 Mar 2023 20:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1678221194; bh=s+k1+xJ5zMnholmT132dNhXwHBo6uBsn5AgH1I1slXM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pVybDHnSgPu4XAOZ4AdPXZFC2chiEhNQcgYo/ogO5rQbXEov/pQHMlAUMVt2ija3v 7p1zS6s0prXqw2Znhj711T6PehBlGTw9LIdDGwRahrl0PrKb2TKLzDLreT1IAg//aB 838IeX2oqSktFoCzI6NiDUO7xzd/V/3cpu8e9xKienV75sQPksiTQ1qKkSP6ulBoc8 g+TH6j2+I+IkBPVRew8VkmZJ8W7LUpQ7Brjrpt2DIZvEKDpUWPmxS9TPlb2Yc0V+/i 1qKdyCMJjGbFwISNGUN90xl4IV1BtcmimAlW6QGTKKNtZ/NwMAfBt3i0QaHaiRHEhr AF9oOQtrCkmjw== Date: Tue, 7 Mar 2023 20:33:09 +0000 From: Lancelot SIX 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-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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