From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5PLPKhcxAGM7CyoAWB0awg (envelope-from ) for ; Fri, 19 Aug 2022 20:55:51 -0400 Received: by simark.ca (Postfix, from userid 112) id A28D21E4A7; Fri, 19 Aug 2022 20:55:51 -0400 (EDT) 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=yJFhjpZl; 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=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham 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 403231E222 for ; Fri, 19 Aug 2022 20:55:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5669E38582B0 for ; Sat, 20 Aug 2022 00:55:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5669E38582B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1660956950; bh=ttbnALmg+RtiSp25Tg+AwlXJMrYag8j3zlWbUtNX1H4=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yJFhjpZlBLGSP0m0dw4W1uBufLqSPAMM9Yv4z2pdlIsAEmcTtRK7W8KPxNy1twLAH U53DEXGHZm/Lo4GSSd5kL+gwRFFuGsVZHdLp73wY7PmSncvwa85sIRKo/BpNmLVmIl lCmmxqkcOfozt0VIQRjNcAdy/AeMz9PpDwc2O3J0= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1D6DF3858C52 for ; Sat, 20 Aug 2022 00:55:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D6DF3858C52 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 27K0tN9b023887 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Aug 2022 20:55:28 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 27K0tN9b023887 Received: from [10.0.0.11] (unknown [217.28.27.60]) (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 3355F1E222; Fri, 19 Aug 2022 20:55:23 -0400 (EDT) Message-ID: Date: Fri, 19 Aug 2022 20:55:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] dwarf2: Fix dwarf stack fetch array view size mismatch Content-Language: en-US To: Denis Lukianov , gdb-patches@sourceware.org References: <36c80f43b57fcfce3b9db6619e75366db360ae9c.camel@voxelsoft.com> <8bfea13a0966a62eca9cd39617918cff04915b34.camel@voxelsoft.com> In-Reply-To: <8bfea13a0966a62eca9cd39617918cff04915b34.camel@voxelsoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 20 Aug 2022 00:55:23 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: andrew.burgess@embecosm.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-08-19 17:33, Denis Lukianov wrote: > On Thu, 2022-08-18 at 12:27 -0400, Simon Marchi wrote: >> On 8/8/22 07:24, Denis Lukianov wrote: >> >> >> Your patch reminded me of a pending patch I had in the same area, >> which >> I just merged: >> >> >> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bde195b84a862f31ac111c0881ad13b89ee89492 >> >> Maybe you were seeing the same problem as described there? >> >> Simon > > Hi Simon, > > Your check_typedef fixes my use case on little endian architectures. > > However, note that DWARF_VALUE_STACK case also re-slices the source > val. It looks like after that it remains mismatched to the destination > which also must be re-sliced to match (as per my patch, or implicitly > back when this was a simple memcpy with a single length). I have no big > endian resource configured to test this. I don't understand what you are saying. All I can see is that the source array_view size will be of the length of subobj_type: we call slice with length == len, where len is `TYPE_LENGTH (subobj_type)`. And the destination array_view size is also of the length of subobj_type: retval was allocated as `allocate_value (subobj_type)`, so its contents are of the length of subobj_type. Simon