From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iRLYHg0Shmm/QiwAWB0awg (envelope-from ) for ; Fri, 06 Feb 2026 11:08:45 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fqR88K9I; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 79FA21E08D; Fri, 06 Feb 2026 11:08:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,RDNS_NONE autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (unknown [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 617521E08D for ; Fri, 06 Feb 2026 11:08:44 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id E61984350A8F for ; Fri, 6 Feb 2026 16:08:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E61984350A8F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fqR88K9I Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 2BA9E436826F for ; Fri, 6 Feb 2026 16:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BA9E436826F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2BA9E436826F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770394097; cv=none; b=VXu7mW5gI54mSeR3PbevyAFT/Bbz9eH8bQdWDM3ugjEq9z+XuJ/ObDKfUAnoR0tv/WAtiHvHtIHV4tXY9p3JZihDwsFljac2m/v8li/hruMOrty1U2AJRCOgqYsD+pXfDGHVPESNtwUIOWH2rM+3pLYcrPanfJQ3FzZQSrlfwq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770394097; c=relaxed/simple; bh=Qv32XLk3HynB3oAv6eSmAjnqB2rQzmv6TcNJvx9Jkw8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=nPzdzaCk/+fNtW8TmwiSXIY2kDqBp7AZ+PrgH7L3jowyTPOsgJIXZHtZVRuM67kNH/xTINkk9gRb1JhlUY4TV0y8KhQpPWs+w9vYX9YMoKt2ChDN/FmXIjVjwEmZTY6UHe5XWrXwQk01DiEqCWm6JWvmC2W2ooUyWDf7tkYB1b0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BA9E436826F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770394096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YoqcvVhbkm6rSiMiPONKU+1Oz7HO4fT6uTYNJzV3I4c=; b=fqR88K9I1bIYH5P75M3M24R7TbnMvHkllmIzn510O3FoJcI2lFE55Jh9qIj71sz3e51/6i 6VXdRFwZ7n4/VVErnabBZUm01lCJZ3UgkTQ6W+hLnhDkUVv7UlWBm6etDUnhdG/FKCqUTo 98DtTGB/NB69crjlfgaCV6tLKxmf5yA= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302--f_seJN7M36Brvo1h8z6-g-1; Fri, 06 Feb 2026 11:08:15 -0500 X-MC-Unique: -f_seJN7M36Brvo1h8z6-g-1 X-Mimecast-MFC-AGG-ID: -f_seJN7M36Brvo1h8z6-g_1770394095 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-79269803c05so11163547b3.2 for ; Fri, 06 Feb 2026 08:08:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770394095; x=1770998895; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YoqcvVhbkm6rSiMiPONKU+1Oz7HO4fT6uTYNJzV3I4c=; b=ivTCVwDzkfDEG5DitRSfFDhnx2piRYMBvdMDf3fnW4GYkDkff36bic9b7OJDDObWuO JHLSeosUIvvtBTYw3gJ/pTgQ3dvul3arw5TMemowlRUWiuUXNWGaAtS1QYUBNQejopJq 5xqHJx9XCvic0hdhvP7xNV4fL4nxIhRA5My2Cm5OAlcSd9LgfroN5VEWR24E1JBxBaNK zM0q9rLGQYPsIEJQ9HU1rfPbVv2zOZa78McOMmy0hQi9gtG9uCytn8cIju3liYNOO3s0 Bx/RsIVyKM/gLFJwJ33VER6JsVcYvxlVHrgoQuv29NyE6a21WUS0Wbc2ReO4qapcphcA JMBw== X-Forwarded-Encrypted: i=1; AJvYcCXV3CPwo5MQA3VirK5a2NeeylAOaKzjQRz1W2NghwgxMFikWOdJnOllV4gpNJlWstfRoOpKb4Qe3L2F6w==@sourceware.org X-Gm-Message-State: AOJu0YzLjYDRSGIqKkHdFildlnEIO7l34/xvxCrSyqFIO3vwuJAwMPbM r2lJKbSe6fmzLrywz9LvluBDYxw1+HItlv0mO2xuIGlfIH8NzgOU0KHlUBMZVvOHg2WbBv6QMSO yja4yW+8A7SmTRqZVzjqfb9OSZm72JmP3jqm/ulnTMPyymNN8d0kkxHsFBBVYOLQ= X-Gm-Gg: AZuq6aKlppOA7MyhZ6lKw50G4bAIhv92WOYv/lLMu+LLUr9XO9VpmeX6NZN1A24S7lg 05TjebIvVlZLHFpqAKJITgjA23+ZriuHixMVqov0CMKl6xM0HA9LXn/8cD6qkUqapmvVpOdGDIT ey+FENC9UDKyw92z2VaxV8b9YqpK15+TTt66hpPKm5m0QCOs2tK889492HO+xxIRotvLg+ookud aHcjyvQyNqsGzI+4RPbYd8vuC46OU4stFaTwWWMaxZEPvCwVdTaXf2L13MBX/p7qNrknxCUgFWW G8anyNyBBichCPrLDC0Y2+WmFVdOapGqJA7Wmen1I0IcRDSvzqfyA586IsLzxxFCsSa9AD+k/Fl gdNzXsLTlx/eXA3I1zpuezg== X-Received: by 2002:a05:690c:4510:b0:794:e463:d084 with SMTP id 00721157ae682-7952ab7030bmr30622177b3.64.1770394094831; Fri, 06 Feb 2026 08:08:14 -0800 (PST) X-Received: by 2002:a05:690c:4510:b0:794:e463:d084 with SMTP id 00721157ae682-7952ab7030bmr30621577b3.64.1770394094196; Fri, 06 Feb 2026 08:08:14 -0800 (PST) Received: from ?IPV6:2804:14d:8084:a5b1::1002? ([2804:14d:8084:a5b1::1002]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7952a28ca8dsm24564547b3.53.2026.02.06.08.08.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Feb 2026 08:08:13 -0800 (PST) Message-ID: <34266c62-3b55-4718-8eed-d5003862c55e@redhat.com> Date: Fri, 6 Feb 2026 13:08:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] gdb/block: remove block_iterator::d::block, remove union To: simon.marchi@polymtl.ca, gdb-patches@sourceware.org Cc: Simon Marchi References: <20260206025238.3467043-1-simon.marchi@polymtl.ca> From: Guinevere Larsen In-Reply-To: <20260206025238.3467043-1-simon.marchi@polymtl.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: XXeTOqgsKTUe2SL6hs2dBs8Fi1Ls95Rk14HiYzhWsd4_1770394095 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 2/5/26 11:52 PM, simon.marchi@polymtl.ca wrote: > From: Simon Marchi > > The block field is never used. The block is only used to grab a > reference to the mdict, which is stored in the mdict_iterator. > > Remove it and remove the union. Leave the compunit_symtab field, whose > name unfortunately conflicts with the method. > > Change-Id: I09dbc42f937eaba6c70598acca8ff355c4e5bdb9 This change looks harmless enough, but since I don't feel like I understand it well enough to properly review, best I can say is, no issues running the testsuite or rebuilding, so Tested-By: Guinevere Larsen > --- > gdb/block.c | 9 +++------ > gdb/block.h | 13 ++++++------- > 2 files changed, 9 insertions(+), 13 deletions(-) > > diff --git a/gdb/block.c b/gdb/block.c > index 64ca59d44a1d..5aa58545393b 100644 > --- a/gdb/block.c > +++ b/gdb/block.c > @@ -407,8 +407,6 @@ initialize_block_iterator (const struct block *block, > which = STATIC_BLOCK; > else > { > - iter->d.block = block; > - > /* A signal value meaning that we're iterating over a single > block. */ > iter->which = FIRST_LOCAL_BLOCK; > @@ -428,14 +426,13 @@ initialize_block_iterator (const struct block *block, > directly. */ > if (cu->includes.empty ()) > { > - iter->d.block = block; > /* A signal value meaning that we're iterating over a single > block. */ > iter->which = FIRST_LOCAL_BLOCK; > } > else > { > - iter->d.compunit_symtab = cu; > + iter->compunit_symtab_ = cu; > iter->which = which; > } > } > @@ -446,9 +443,9 @@ compunit_symtab * > block_iterator::compunit_symtab () const > { > if (this->idx == -1) > - return this->d.compunit_symtab; > + return this->compunit_symtab_; > > - auto &includes = this->d.compunit_symtab->includes; > + auto &includes = this->compunit_symtab_->includes; > > if (this->idx < includes.size ()) > return includes[this->idx]; > diff --git a/gdb/block.h b/gdb/block.h > index d9a8c4b6ff89..b84ca12c35a6 100644 > --- a/gdb/block.h > +++ b/gdb/block.h > @@ -557,14 +557,13 @@ struct block_iterator > iterates. Return nullptr if the iteration is finished. */ > struct compunit_symtab *compunit_symtab () const; > > - /* If we're iterating over a single block, this holds the block. > - Otherwise, it holds the canonical compunit. */ > + /* If iterating on a global or static blocks, iteration starts from the > + top-level CU and then continues with the global or static blocks of all > + the included CUs. This field holds the compunit of the current block. > > - union > - { > - struct compunit_symtab *compunit_symtab; > - const struct block *block; > - } d; > + This field is not private because block_iterator must remain trivial, > + but treat it as private. */ > + struct compunit_symtab *compunit_symtab_; > > /* If we're trying to match a name, this will be non-NULL. */ > const lookup_name_info *name; > > base-commit: 1d688bb5f48a0feddf3ca3c60af2e91f4147dc36 -- Cheers, Guinevere Larsen It/she