From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qQ4bJLoYhmloVywAWB0awg (envelope-from ) for ; Fri, 06 Feb 2026 11:37:14 -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=Ac3Rsrrg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8E3F21E0BA; Fri, 06 Feb 2026 11:37:14 -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=unavailable 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 277F71E08D for ; Fri, 06 Feb 2026 11:37:14 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id B7D4D4399F43 for ; Fri, 6 Feb 2026 16:37:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7D4D4399F43 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=Ac3Rsrrg Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 9EBD04509BBA for ; Fri, 6 Feb 2026 16:36:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9EBD04509BBA 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 9EBD04509BBA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770395808; cv=none; b=x90A8dnSrwqIt4hIHNa8RdXeC7l41fRLYLir+ivFJ1Q7mihEoP0da10Q6A404qK9P6DvRX3uJqvQjjbuZL0rEMRCAgJ38x/EjiuXkrq5QDLEiP15Mns26//IhMFBu5PqQ0xIEYFbNmmJHyIEop+dqKtuaz0AsxI+qjglbg2AhTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770395808; c=relaxed/simple; bh=9oWtqf7yaFJX44ElBIOEhdOiPERo6m2NbwKwiPLEkYc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d42sWQmFmduyoEe/kvTqvCSPZo9NjoqNpKB6RRQOb5ZL3RUWn7rFXkYddOjvufCyVuJlijHrr/OlE6h/si9WARtDfXzh25FuRfDK2HmVn8nJ+5sh0hlZ06y+UcCLiWjfkiJtoWbR77hIUGq6ZKfJEpXGN3wexKhRxgzxewuwwuQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EBD04509BBA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770395808; 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=W9pISOVoBTeEqjOJlMxwdRKpkpYsXya1pQiMJigCUeg=; b=Ac3RsrrgC6pZTGLuQ+PPkFTgXDMjHUJ9q8e8xZyTuGTmuIE2BQPhJb+SG+ybz4HVCQVTQp e6eGzjzYFwXFmMQqCPq/8kwL//+reIQykPJu8GVOSTWPzFYSMbH6nHDZ6YytvPlTDQ46WN XgZbJVcGxlRvVRlFmi6iVLEMJZQcK+U= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-IKZCbm1fNpyr433_EpbU4w-1; Fri, 06 Feb 2026 11:36:46 -0500 X-MC-Unique: IKZCbm1fNpyr433_EpbU4w-1 X-Mimecast-MFC-AGG-ID: IKZCbm1fNpyr433_EpbU4w_1770395805 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4806cfffca6so30757825e9.2 for ; Fri, 06 Feb 2026 08:36:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770395805; x=1771000605; 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=W9pISOVoBTeEqjOJlMxwdRKpkpYsXya1pQiMJigCUeg=; b=WhWXqezzJYfVIW1YEReoBVixtWm2fR3leN80uAsszJp9hNvXljSgGEBzIgg8qB6Q5S DhkbnVHhTmxRZh2A9M4vpPq6JJFcClcBLo8OP04K74QpiFmbWFTshAVMwHDCMAzi4Ww2 EmsPREdaUvczzL8k+BC+l1JBvZQBkZX9RJFYsD7OPMN6oEn7HieOC2jIsD8tGIOlYPlD mdMhIelSQp6PyJk4wOk9i2yOZCXdHxzpj8+/fWZkHEth6cASFr+wHFERce7yqlXOHInm auB0DyAmdqVCI304DtClUtPdwDDgUiOZwMM6i9a4aGPUXmS5orrj+fbVwnWEU8lUvLPb ecmg== X-Forwarded-Encrypted: i=1; AJvYcCVheC2yFR9YIW+aFquyg6qvengwqAe/otZhYffzBpEBaVbyHaTG/iCwEjai+/hcNrrTt1lp2IxE0Vn3pA==@sourceware.org X-Gm-Message-State: AOJu0Yw0aLpIbOwKE2uDjyOwtwKYC0LPuqZn2RiNpHzdKIIS04kfoUbt +0+ifc1IVYkJlaHUpgNAK3F3SHrAleW999E9nX/ncZSUqFZnygNE5ijjWdk9lV8LkYumxcJA3KK d4p2FsUt58olzafvc1lpFfIcX7KxcTBCqogNPwkP9+KnroCb3Y+uodBAMb3ndKvDdCdL9cLw= X-Gm-Gg: AZuq6aI7uZI7WO5XkEzh2wnqJCrHi3Fs/unpkUnHo2OUrxybFz04xHfGeMiVDogtgZa m10vj1saiWd7vYD9XdZk4iNkDY0/w3OFkKIa1QgZJWCm5sty3B6T45643BkcIT2+Kwrzee/mhoM UFY7TUHfPX0+1zXhttTm3/3bKKJRygPZzNNfhq2JLQYeCiK9EPzl1TQZFHDAIsgwKdFPh1Z6/6V WIrh2Jq07aCWc6iHD1HfC+LCcnk9iSwf31NAQrGELmYtcZMNoU/Ese6zpYCp67kDBu/EKrtwSIO xUpJbV+VH2HMt/q8BdaC7ksHRRMzNZ+6GgnTBAP7JNqSHIpOn5AUVy9Spgeq3vtB0RGzqo32oRL 32xy/ X-Received: by 2002:a05:600c:5491:b0:477:c71:1fc1 with SMTP id 5b1f17b1804b1-48320216d3dmr49407125e9.19.1770395804682; Fri, 06 Feb 2026 08:36:44 -0800 (PST) X-Received: by 2002:a05:600c:5491:b0:477:c71:1fc1 with SMTP id 5b1f17b1804b1-48320216d3dmr49406855e9.19.1770395804214; Fri, 06 Feb 2026 08:36:44 -0800 (PST) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296b34d2sm7546378f8f.1.2026.02.06.08.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 08:36:43 -0800 (PST) From: Andrew Burgess To: simon.marchi@polymtl.ca, gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 2/2] gdb/block: add assert in block_iterator::compunit_symtab In-Reply-To: <20260206025238.3467043-2-simon.marchi@polymtl.ca> References: <20260206025238.3467043-1-simon.marchi@polymtl.ca> <20260206025238.3467043-2-simon.marchi@polymtl.ca> Date: Fri, 06 Feb 2026 16:36:43 +0000 Message-ID: <87o6m1de1w.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: bcf-JCvigOJREL9GDCYskSfz1RTuz4p8KdaudhNwoIs_1770395805 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 > > Verify that the compunit is only accessed when the iterator is in the > mode where that field makes sense. > > We could also set compunit_symtab_ even in "single block" mode, it > wouldn't hurt, but it would not be useful either. Approved-By: Andrew Burgess Thanks, Andrew > > Change-Id: I237db16bb485148f9e906b2e7238159e9f0a8585 > --- > gdb/block.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdb/block.c b/gdb/block.c > index 5aa58545393b..730e4580a5b7 100644 > --- a/gdb/block.c > +++ b/gdb/block.c > @@ -442,6 +442,10 @@ initialize_block_iterator (const struct block *block, > compunit_symtab * > block_iterator::compunit_symtab () const > { > + /* The compunit field is only used when iterating over global or static > + blocks. */ > + gdb_assert (this->which != FIRST_LOCAL_BLOCK); > + > if (this->idx == -1) > return this->compunit_symtab_; > > -- > 2.52.0