From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id r35sDYsYhmloVywAWB0awg (envelope-from ) for ; Fri, 06 Feb 2026 11:36:27 -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=NNulcBk0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 228841E08D; Fri, 06 Feb 2026 11:36:27 -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 8CC9F1E08D for ; Fri, 06 Feb 2026 11:36:26 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id CB95E43796D3 for ; Fri, 6 Feb 2026 16:36:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB95E43796D3 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=NNulcBk0 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 A94E643E41F7 for ; Fri, 6 Feb 2026 16:35:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A94E643E41F7 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 A94E643E41F7 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=1770395759; cv=none; b=pKwAV76qHYf6sG/SXSpVt/UjwJUFeqW4wjWSx6y7OLPfCO74m2oL+geB9ve/PK1BeVvZSMov1ehdEefHAnQUKL9EHT6XRnotckizusNPZWk2bHhD8j4bFKc5YQCVp+OurjnD2mhqNXa48r+dJPKwVCpdZ0RjExynl/Qof0aRcDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770395759; c=relaxed/simple; bh=Yco7ccaQfecHsyqTnu9X44a2epfnNurT8tecEIWo4G4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ET5B0hmFYyhe5h5iuOa3p/NdoNsrui1ueiR6A4gnCfVJ3lAd9325kIcyQI0U0/4eh9DSrwNAD25aKJIxQTKSCWNhAQAW+oo0lS7R26jPGMTuFjIhSObyeLfQ5bBPa/gO6jLF5FZ0EQv/EUMFPbnv+x8a4k0FK/BvDMtJbv1UbJA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A94E643E41F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770395759; 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: in-reply-to:in-reply-to:references:references; bh=6FaP0UmHg8J0eUjJGRioLldRv7uOHkryUJ/zVjmF19c=; b=NNulcBk0VngnKOBGnD6By2Xj7p3iPY53hj3o4IMNY2lqFipFecw5bnepckxFl94WYlVwoI Y5zHBfqsQmeGpCEBktYHZqGsfL/d2cj9m0teqHRfr4ku7ABV/WWzwHqXVNz/EKEJuf3Afw Wuhwo8kEFgB1kFUExmv4marCYcyo0GQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-BTXKFPOdP8m86SSl6AtTkg-1; Fri, 06 Feb 2026 11:35:58 -0500 X-MC-Unique: BTXKFPOdP8m86SSl6AtTkg-1 X-Mimecast-MFC-AGG-ID: BTXKFPOdP8m86SSl6AtTkg_1770395757 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4802bb29400so23199975e9.0 for ; Fri, 06 Feb 2026 08:35:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770395757; x=1771000557; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6FaP0UmHg8J0eUjJGRioLldRv7uOHkryUJ/zVjmF19c=; b=o3PX2QAf+4llZd3TfA+19uy62qrYJK8eC2BkKe0IuTSJ1cTACKsorgISRRn8bB5UH0 i5uuxB0nhhU7TUVR4/mlb2J232Hofd0bmufunaA5ZD8CqzzAsoP0sko/LIJckrkqGnEG Qubrp8b9JbF58+5+rtt93q0of6RFLJhULdeUYp8r67Q4Flo11i32ORylcL6b+DUUaEuT xaBWPv4iN3xy+nj+xFiY26/TPeC1KbggdHq0e9e6hU/AQ2ihWYiwc7a+1E3sL4oOHyVH D3jhwfhlMIbqJiHS5XwYBwSVam+7JvithaV7oonKMafMqM18a7cC2h3OM0R4lN/usAd0 PDrg== X-Forwarded-Encrypted: i=1; AJvYcCUUyXPUzKgr2F7JI8Io+eIKqLK/asIczLlg0DlJr2U3hfD0/q1YkzXXGSLDMNdQpaZizzbQqhvqn3548Q==@sourceware.org X-Gm-Message-State: AOJu0YxTS+QfQi+HOmOWcnxV0sE7Q0fhQFx8BFSOh67eC9iqy/6KXVTh VIAMZoq0vnOG2RlN10TnDYhUTMyDe/g2fuw9ARDxElSVGigiD+Sqxvmg5JJRyYTUaQx7FI4axLH MGUeh733qqLLL7HqoJHOXbOJnefwZL8EezIp630hjqvST3n/MHIzx6mBNwsRWQS4= X-Gm-Gg: AZuq6aKjQ6DmSe2bKAsgk1TXSK/4bt1LWAq7gPY91D754Kw95gSKXJQRpvX/7UlhBm7 wHl7N04oci47k7ks0Fo78Ek3TwN3doXKQ+4eNdM9AKIlfxy8lFlYp+/UZ8oPGQb2fJCGKYOkokE op/MKju/0EF9YvEak+sb+7SiW0P6zMZh0KzSkseiQKnYvN9n2Ll31pMdlCHf5GQz5yPdl5XbwAU u4nAs38E+kgwptJZYHVg1Ovhnwrfa9ls2iXTus+J1G+ZHvpXvs4MWJ/CNphgRTP5yjhYiDlfDyT US/1Q0DH8214bCM1i1xMUuJ6YypY9kqsBEOkf2DKinFQE8xRZQpHn30cIbJ4OVUASMKCpEwqw4w hznS0jnmF429h4ZoR X-Received: by 2002:a05:600c:4fc8:b0:46f:c55a:5a8d with SMTP id 5b1f17b1804b1-483201dc396mr49123415e9.4.1770395756805; Fri, 06 Feb 2026 08:35:56 -0800 (PST) X-Received: by 2002:a05:600c:4fc8:b0:46f:c55a:5a8d with SMTP id 5b1f17b1804b1-483201dc396mr49123075e9.4.1770395756384; Fri, 06 Feb 2026 08:35:56 -0800 (PST) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483203d5ef7sm34658255e9.1.2026.02.06.08.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 08:35:56 -0800 (PST) From: Andrew Burgess To: simon.marchi@polymtl.ca, gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 1/2] gdb/block: remove block_iterator::d::block, remove union In-Reply-To: <20260206025238.3467043-1-simon.marchi@polymtl.ca> References: <20260206025238.3467043-1-simon.marchi@polymtl.ca> Date: Fri, 06 Feb 2026 16:35:55 +0000 Message-ID: <87qzqxde38.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: S8nL2rl4ZMWOMBbC9JIchItuXTLYO6B5uAGk_lKmHK4_1770395757 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 simon.marchi@polymtl.ca writes: > 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. Isn't there a contradiction between these two sentences? Either the block is not used, or it's used to access the mdict? Thanks, Andrew > > Remove it and remove the union. Leave the compunit_symtab field, whose > name unfortunately conflicts with the method. > > Change-Id: I09dbc42f937eaba6c70598acca8ff355c4e5bdb9 > --- > 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 > -- > 2.52.0