From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fgNGMC+V1WHmTQAAWB0awg (envelope-from ) for ; Wed, 05 Jan 2022 07:55:11 -0500 Received: by simark.ca (Postfix, from userid 112) id B2CC11EE18; Wed, 5 Jan 2022 07:55:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 392F01EA69 for ; Wed, 5 Jan 2022 07:55:11 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FAA93858433 for ; Wed, 5 Jan 2022 12:55:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FAA93858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641387310; bh=ONuJbRECbkDhUYXY8i2IRzeXh5TOzA/0GLr6WKFPzHM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uJWqB07BLDJnSevaSnEoLnXwBgqmDSGFKqm71DgLWVeeAFxu/yALW4+MyuJxI0yGh h7sPGgQtU4UgaGwvPvmOgZKGEdfGJ+T5W4risez7uv9m0Np8z357aLizB1AV5mP7Q5 AK2Hrh4MoyFUnUhR6cTgrpuHPf9HLwbwJ8KETzsE= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CF5283858400 for ; Wed, 5 Jan 2022 12:54:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF5283858400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-437-lWT7xA6YOK-5vDenIP5Xfw-1; Wed, 05 Jan 2022 07:54:50 -0500 X-MC-Unique: lWT7xA6YOK-5vDenIP5Xfw-1 Received: by mail-wm1-f71.google.com with SMTP id 83-20020a1c0256000000b00346a78f8fd7so900400wmc.8 for ; Wed, 05 Jan 2022 04:54:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ONuJbRECbkDhUYXY8i2IRzeXh5TOzA/0GLr6WKFPzHM=; b=tahqxMOhtn8oDBHFUOF7P3kqa1oVO4XgIoccV+MFmvGI6UQ3ExjUB0YdRNK2HCLlIO BQsaz0hxfXp7tHnrw50/x1dj+5NZmyiczVt38L5DBSMMeFct2KO7Ko+97aFEvh54YYQS xSJyh32HlO6akJfcu9H+A9D+BU1vRArpb4l1SD501M5c7G/ryPbx9Z5uvHxtejpdx593 RXwZAyRb6GMIgN1KQQ+SMlSUZDtyJsWWn2+IXWLL/NJVqRZPaFctk0SKfNeBEGteb52Y +WPyMz0tR57uxlyc4MpR6MipAwgiWgerLsEXRESumk1xnl/qYl2jF5oBYmGVjJP52E6j z6LQ== X-Gm-Message-State: AOAM533m3Vb3Ul5pPwwZB0GP/a0/4w8/bX7O0DvO4a4SHpVLhfKZPWRD D/23elcQbav5/SE2YetawSrpUoqhuKFeAdUfyQQL9LPT1AfHOIDiAiRNdzLMoMLsqQfrL7HvO2g vW6xJ+b/3OHPjT6uuTxTtMw== X-Received: by 2002:a7b:c7d0:: with SMTP id z16mr2798257wmk.76.1641387288939; Wed, 05 Jan 2022 04:54:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBX29Mn6IuzZB/vivhwxBeve5xqp70jH1a/Bo7g7/msdSKwHXKb97ZkjoP3gDyjlRlN6vmbQ== X-Received: by 2002:a7b:c7d0:: with SMTP id z16mr2798245wmk.76.1641387288806; Wed, 05 Jan 2022 04:54:48 -0800 (PST) Received: from localhost (host109-154-163-67.range109-154.btcentralplus.com. [109.154.163.67]) by smtp.gmail.com with ESMTPSA id r9sm1851548wrm.76.2022.01.05.04.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 04:54:48 -0800 (PST) Date: Wed, 5 Jan 2022 12:54:47 +0000 To: Luis Machado Subject: Re: [PATCH] [AArch64] Fix PR gdb/28681 Message-ID: <20220105125447.GF621762@redhat.com> References: <20220104172254.3665546-1-luis.machado@linaro.org> MIME-Version: 1.0 In-Reply-To: <20220104172254.3665546-1-luis.machado@linaro.org> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 12:49:26 up 3 days, 21:43, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Luis Machado [2022-01-04 14:22:54 -0300]: > This is the same as commit b1718fcdd1d2a5c514f8ee504ba07fb3f42b8608, but > fixing things for AArch64. > > With the patch, gdb.cp/non-trivial-retval.exp has full passes on > AArch64-Linux Ubuntu 20.04/18.04. > --- > gdb/aarch64-tdep.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c > index 70fb66954a4..802762f303c 100644 > --- a/gdb/aarch64-tdep.c > +++ b/gdb/aarch64-tdep.c > @@ -2323,6 +2323,15 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs, > valbuf += X_REGISTER_SIZE; > } > } > + else if (!language_pass_by_reference (type).trivially_copyable) > + { > + /* If the object is a non-trivial C++ object, the result is passed as a > + pointer stored in X0. */ > + CORE_ADDR addr; > + > + regs->cooked_read (AARCH64_X0_REGNUM, &addr); > + read_memory (addr, valbuf, TYPE_LENGTH (type)); > + } > else > { > /* For a structure or union the behaviour is as if the value had The aarch64_extract_return_value function is called exclusively from aarch64_return_value. After calling this function the aarch64_return_value function returns RETURN_VALUE_REGISTER_CONVENTION, which I don't think is correct in the above case. I think we should be returning one of either RETURN_VALUE_STRUCT_CONVENTION, RETURN_VALUE_ABI_RETURNS_ADDRESS or RETURN_VALUE_ABI_PRESERVES_ADDRESS. I wonder if aarch64_return_in_memory should be doing more of the work in this case? But that's just a thought, I'm sure whatever you come up with will be fine, so long as the return type is correct. Thanks, Andrew