From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0FYYIBGX1GH6LAAAWB0awg (envelope-from ) for ; Tue, 04 Jan 2022 13:50:57 -0500 Received: by simark.ca (Postfix, from userid 112) id 81BC61F0DB; Tue, 4 Jan 2022 13:50:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 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 DAC241F0B9 for ; Tue, 4 Jan 2022 13:50:56 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79561385842D for ; Tue, 4 Jan 2022 18:50:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79561385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641322256; bh=tQMSdebRyl/l44bBEH6XIGGZrl9gZ/WxNWzvWX2hilg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Squ8liW1hdaOcakhL0s9kAXf7yNU+xD3PWCyKpwBq1WUYwy5SiSaXAa8MO6xEsrYD 17UhA7LpRdJ5vCwbjUa90wEBOoDaZGU/b6u9D/TH9C2Fccm95zqLN3Y7JpIUQtGJaK 3vwqFNmozN2M8+CV2s168GC9z/WMKyIl7Dh9Snkk= Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by sourceware.org (Postfix) with ESMTPS id 7584E3858424 for ; Tue, 4 Jan 2022 18:49:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7584E3858424 Received: by mail-qk1-x72f.google.com with SMTP id l11so35739577qke.11 for ; Tue, 04 Jan 2022 10:49:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tQMSdebRyl/l44bBEH6XIGGZrl9gZ/WxNWzvWX2hilg=; b=czUNj0RVZnnWFX9Lyd+tx0UKQzHxLQdc8khxA9VLL1CFesTsRfcfYicGQeb/KZSfRV Fl87C81JSJTvqWz6JJyoAr5oCMFXo9dzuoE0DyRuH1imI4V9Cm1T1+FyDQAMocZqKhfC 4qtiMxo/ibP0OdLqaIc4hfBqZAdJ9e85d5aynDYlze1TzXgh8bB2n2/Yg2fyBoq/7+sm V8xwAE+omvlx+FoVobP3sbUQ5ZCnXwUS3jfaBh1FBM31P/OkO9Xhw4gfoqZ/UiOPhzIc 8TggxWLnZJowBlQWB6GwUm9bKY+wf6yVu9A9iFMoPEcdZoeQTbHPqKw30UGOOuUyuoB6 hKZQ== X-Gm-Message-State: AOAM530HRIwFkiPLGcjXrUzcTiR8L4XG20/A0RiWNWKpxU0TvTXndZam eRLp98FzCIiJGRt1//TFmgkaobx6pZqdzQ== X-Google-Smtp-Source: ABdhPJzhnyvVNsbPMlI6FQypSd3NAb2thbg6rTquVq0eQQ6/KkuvLsMd+Z+0qyNV/kADWAGMOrHdwg== X-Received: by 2002:a05:620a:14bb:: with SMTP id x27mr36795714qkj.382.1641322194081; Tue, 04 Jan 2022 10:49:54 -0800 (PST) Received: from ?IPv6:2804:7f0:4841:563b:d924:ff26:cde9:15a7? ([2804:7f0:4841:563b:d924:ff26:cde9:15a7]) by smtp.gmail.com with ESMTPSA id u12sm4195711qkp.120.2022.01.04.10.49.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jan 2022 10:49:53 -0800 (PST) Subject: Re: [PATCH] [AArch64] Fix PR gdb/28681 To: Simon Marchi , gdb-patches@sourceware.org References: <20220104172254.3665546-1-luis.machado@linaro.org> <35890e99-0fc3-49b3-4eb1-59cdf606c2e1@polymtl.ca> <1e813eab-3b10-6f78-4375-d72feace6e7c@linaro.org> Message-ID: Date: Tue, 4 Jan 2022 15:49:51 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 1/4/22 3:47 PM, Simon Marchi wrote: > > > On 2022-01-04 13:44, Luis Machado wrote: >> On 1/4/22 3:09 PM, Simon Marchi wrote: >>> >>> >>> On 2022-01-04 12:22, Luis Machado via Gdb-patches wrote: >>>> 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 >>> >>> I'll let somebody else review this (probably Andrew), but please change the >>> patch subject to something descriptive, not just the bug number. >> >> Did you want the entire bugzilla PR subject or something else? I can't really tell from your reply, sorry. > > No, not the bugzilla title (which is `Wrong pretty-printed unique_ptr > value when using "finish"`), since that is a distant symptom of the > problem you fix. The subject should state what you are fixing, so > something about the handling of trivially copyable return values on > AArch64 (something like that, I didn't follow the resolution of the bug > close enough). How about "gdb: on aarch64 non-trivial C++ objects are returned in memory"?