From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 34E0A3858D28 for ; Sat, 4 Dec 2021 01:45:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 34E0A3858D28 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1B41jPEd011960 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Dec 2021 20:45:29 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1B41jPEd011960 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A45F51ECEB; Fri, 3 Dec 2021 20:45:24 -0500 (EST) Message-ID: Date: Fri, 3 Dec 2021 20:45:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v3 3/3] gdb: trivial changes to use array_view Content-Language: en-US To: Pedro Alves , gdb-patches@sourceware.org, Tom Tromey References: <20211201164905.702081-1-simon.marchi@polymtl.ca> <20211201164905.702081-3-simon.marchi@polymtl.ca> <159b7b78-d071-fa09-b0db-adf7e4715ad1@palves.net> <8a278e96-dc89-ea69-67e5-b890ad4fe23a@polymtl.ca> From: Simon Marchi In-Reply-To: <8a278e96-dc89-ea69-67e5-b890ad4fe23a@polymtl.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 4 Dec 2021 01:45:25 +0000 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Sat, 04 Dec 2021 01:45:36 -0000 On 2021-12-03 16:44, Simon Marchi via Gdb-patches wrote: > > > On 2021-12-03 09:10, Pedro Alves wrote: >> On 2021-12-01 16:49, Simon Marchi via Gdb-patches wrote: >>> Change a few relatively obvious spots using value contents to propagate >>> the use array_view a bit more. >> >> OK. >> > > Thanks, all pushed. > > Simon > I had totally forgotten that the last patch causes an internal error when running an Ada test case. I did mention it here before: https://sourceware.org/pipermail/gdb-patches/2021-November/183252.html I pushed the following patch to revert just the change that causes this internal error. >From fb2a515fd07be61a9deda0ebfe9507f8000d93cc Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 3 Dec 2021 20:39:57 -0500 Subject: [PATCH] gdb: revert one array_view copy change in ada-lang.c Commit 4bce7cdaf481 ("gdbsupport: add array_view copy function") caused an internal error when running gdb.ada/packed_array_assign.exp: print pra(1) := pr^M /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h:217: internal-error: copy: Assertion `dest.size () == src.size ()' failed.^M I am not sure what's the root cause of this, whether it is a GDB bug exposed by using the array_view copy function or not. Back out the change that triggers the internal error for now, while we investigate it. Change-Id: I055ab14143e4cfd3ca7ce8f4855c6c3c05db52a7 --- gdb/ada-lang.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c6cefe9d8e89..f8ba05b42765 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2586,7 +2586,9 @@ ada_value_assign (struct value *toval, struct value *fromval) write_memory_with_notification (to_addr, buffer, len); val = value_copy (toval); - copy (value_contents (fromval), value_contents_raw (val)); + memcpy (value_contents_raw (val).data (), + value_contents (fromval).data (), + TYPE_LENGTH (type)); deprecated_set_value_type (val, type); return val; -- 2.33.1