From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qd8VKnl69Wn5WQoAWB0awg (envelope-from ) for ; Sat, 02 May 2026 00:15:53 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=U33MuO1g; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5FA041E0BA; Sat, 02 May 2026 00:15:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4F9DA1E093 for ; Sat, 02 May 2026 00:15:52 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5AF2146A9CF6 for ; Sat, 2 May 2026 04:15:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AF2146A9CF6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=U33MuO1g Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 71E9D4BB58A5 for ; Sat, 2 May 2026 04:15:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71E9D4BB58A5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 71E9D4BB58A5 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777695320; cv=none; b=JFVhWyQavkRMzvMTY0DZk/ssg/a1uN8Gi+H4BE+NxYlgXWP2KpjETh0MCru4T1NP/WDeb1YdL1gInQWtw6RJjNzeb8U1krtwDNut67ef0xOKTK48HgdRolkPSmDyDniyiHm8KnAuzxSoE489lCtsnxbqCib6ZEg9Ibtp8JUhXYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777695320; c=relaxed/simple; bh=uXX6cfoODaRmzSnipV8NKHYUPkuJmQTxNg3F2RUrIPA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Fvi/v7Tl2SFs5uKsInPSYyM43fYUiN0NK5d1YHR1zG6bkLaer5hUIlKojEzP5BgBBh6T/eIKpEoVi8cjxszrJEd1kn81ZlaY8daCjxGpTytE7pggMDjg0EztqmR+S36fr5WUePMRAGrcmPI4QmU4f2SaagRCRWwUI2k52IsDiAU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71E9D4BB58A5 Received: from simark.ca (simark.ca [158.69.221.121] (may be forged)) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 6424FAO8071354 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 May 2026 00:15:14 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 6424FAO8071354 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1777695317; bh=KiD8FVkwO6wynVKLcxXQbwKcyIJSpAuX5DmLv5Vt/VY=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=U33MuO1gebEBAhgu8PDzSIf6jarst98OVRKWW7B7FgG+IcWEHliMfR71SEPaA/FPk eOAIhAiJmPkFsZ72ANhoQWiM4zPry2IKCzQlDgJNT9s/uY5+52FMgKCDbuaVHXkGm0 BHK+59mJnX2bPpq54tQucEHHy8BmaZx4i5vydJPYi3781LrtOpBOu7HPeg6xtWSCFh Iet6j6gVXuVCCxKHC2Gncsv2zwH3RI1/H+qsBWapiaEPLd0lg7HhKRWoTBHaV8urtz lBa56kjnPBqjmnsG1Uo7zHRyI3ocBLEnfLiqHhLVpMMwOReTGX3SzUTkVojYcEuELB aJgiHc3ervjuQ== Received: by simark.ca (Postfix) id CB1F41E093; Sat, 02 May 2026 00:14:59 -0400 (EDT) Message-ID: <716ea4a0-aef2-4a26-8b7d-7bc46eeda76d@polymtl.ca> Date: Sat, 2 May 2026 00:14:59 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/dwarf2: pass around DWARF expressions as gdb::array_view To: Tom Tromey Cc: gdb-patches@sourceware.org, Simon Marchi References: <20260429010252.927650-1-simon.marchi@polymtl.ca> <87y0i3gkay.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87y0i3gkay.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121] (may be forged)) at Sat, 2 May 2026 04:15:10 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-05-01 12:35, Tom Tromey wrote: >>>>>> "Simon" == simon marchi writes: > > Simon> This patch converts a bunch of functions to take or return DWARF > Simon> expressions as `gdb::array_view`, instead of raw pointer > Simon> and size. It doesn't do any non-trivial change to function > Simon> implementations, but the idea is that we could change them (for example > Simon> dwarf_expr_context::execute_stack_op) to operate on the array view > Simon> directly, giving us bounds checking when building in debug mode. But > Simon> that is not as trivial. > > I skimmed this and it seems fine to me. > Approved-By: Tom Tromey Thanks, pushed. > Simon> This patch also doesn't change structure fields to array_views (for > Simon> instance, dwarf2_loclist_baton), because that would make them > Simon> non-trivially constructible, and we'd (technically) need to change how > Simon> they are allocated. > > I thought this sounded backward but I suppose it refers to the fact that > these are stored in a union inside dwarf2_property_baton. > > A fix for that might be to use a class hierarchy rather than a union. Yes, I meant that we would start to have to call "new" on them. They are currently allocated with XOBNEW, which is disallows on non-trivially-constructible types. I guess that's what allocate_on_obstack is for? Anyway, I had to stop somewhere with this patch otherwise the scope creeps too far. Simon