From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QaIuDfF64mkZvR8AWB0awg (envelope-from ) for ; Fri, 17 Apr 2026 14:24:49 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OKvQGPJ9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 323A81E0B1; Fri, 17 Apr 2026 14:24:49 -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_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 9FA8A1E04F for ; Fri, 17 Apr 2026 14:24:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 70EBE4CD200E for ; Fri, 17 Apr 2026 18:24:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70EBE4CD200E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OKvQGPJ9 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id D639D4C91769 for ; Fri, 17 Apr 2026 18:24:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D639D4C91769 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D639D4C91769 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776450248; cv=none; b=WfVuGg2kfvLH/DZXI+yCIImIx/Vub5Z/48USuByh0HYt+GZnUlvr9kCplyHLrAZKfiBBg8w76x16waWenYe/2jo+zmmqNaXG38XR7CwAc4mNBIOX0NJiM+Q5ezx9PUOmjuXSlDLh4zsH0nk2S46kuCGEXhBm5rsAquq0FNReaD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776450248; c=relaxed/simple; bh=e0+Lnn+2OPmb00FmIOXZtMqK8GjCuQBo91wFflZc8VU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=b0NH655u1mCm0U9L3PFPXpPekz+BGifzZ5KLGsAInRwbdKpr4llfD84IYPhpWck9I5Vmlx5d9wgXdrT76EYuDcmC+edRjlo7OVdvs1EVoKBWry/LeMwHXnY3PwHMNKA6BGfODBQk+U0JBXlTlqXLbpnAp7TOwz0dVCIfKeSE9Wk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D639D4C91769 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7dbb89ab229so939790a34.1 for ; Fri, 17 Apr 2026 11:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1776450247; x=1777055047; darn=sourceware.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BCGQjZQFPHvI491T0esVwY2pBSbjS96HxfEFJOSEOKg=; b=OKvQGPJ9Qug2AUtel8OXY/KAHKGlc35NhMf9qMpLs0E6OGO6JwbdVrnjvC68Yhdbsh UGnXnjJABXSo37plEFVLXgbUX6+mIKCO8RkSrkF3kk5Yk9IWJkjSQHhgoyAoSpEXQ3P1 Xh0R3qCP1a31MW5iAEziefnReKHUohbLVKYRPP8062JGJukEpbBxgJhPzpMrIqgwcToA +vEx5dGjxZeQamHQjGUbX6sI50iKNp4pgPezBiLNiAGwk3jYfWxuwN3rWMMOrOQ+jw08 aZbULdlL+OAUxpMoaWC3z5CvXSEnLH2dnhvxpVjEV6Mzu8U1ZCqg71I8+J7nr6Lzcau1 Nlzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776450247; x=1777055047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=BCGQjZQFPHvI491T0esVwY2pBSbjS96HxfEFJOSEOKg=; b=TlALYsdMMEPpyGAVoBljoLh8ppdkxLSYs3tW7V13nPdDxLD8siPu3WyFU3HF+HpSIZ pkj36i2YTKezCqonj6lbyIZ9rpSto4lwumlTVV2VtPbOfX9VNBb+ZHdkZhfNY8HPvkK1 YqVd36JoMcevokyj3oTvx1u8a5GpFaauufKgzq/3vBIA9ro/nNAvOn15X+gmYgA7cTS4 ONYUIe6mxcukOZ94cu1R2dffV2CQt8FZKcKFBEH6+EFxoLJE6Iu2umL92S4+FiKf+MdG slPae0KieNvhHnUOcJ0JSO+TRZbjaJN8tYEPlIfbkPQ4bQKDHJUnF/SCKxVEwm+pqS8K 9KvA== X-Gm-Message-State: AOJu0YwE9sjt1wlmWCU2I7Nf5i/Lqtz748iMOU+rwSyRK7lVjKR4jB9h dSuAyN5srh5vZIojHeFR44jJ6zFyt9LuFB3BRMXI8H49P14leu2cYS1asO2Mrw4Cg8NXLbXELl7 mkBA= X-Gm-Gg: AeBDies+fnmTy3tASGJNm5E+6Sd9Pm17SEneGTQqS/UfjSuiZvCGzTfk868c77hVDsy vQDIhfO5nrdq/dac9WvZ+U5uq89Lb5C6iaC9KC4Q6rIiQprNNkDYJ+9pd/BzFmfWhKC1VJ9FR8q uNbLqVRRxLek3jSFxBSZvCBnJeAISo2jfUvX9yWMmL7FJqPUXBbR4FZhN5Dtobm9PPC9nfbvOVK E2xtJzVOvyI3WCPkvXZ5hRSnaJZAGehq0W0U46yM6l8Dm1I+fXIios81lZLJr8wCjxKt7lcidUE rKFLHb+I3Dgcp+JT7gDEXBWttjV7TjWyff7xXmzOpHZ5qGXIwHj27F0hok2518b4c0bKywDt1zQ 8ooBegISKKng2nmWiISybmenSh46Oq1qB+Ajoxc0EDPfZBv3NAvCxY/mnu2zkMWu9IAl1JuxMzT J36jNSKpmeltV6T2hOYc6GjElLjXY+0qad4pMbcKKzpi9QyFiiHW43l/RVBwXAlbij X-Received: by 2002:a05:6830:719e:b0:7d7:57ef:384d with SMTP id 46e09a7af769-7dc951c262emr2876663a34.16.1776450247096; Fri, 17 Apr 2026 11:24:07 -0700 (PDT) Received: from [192.168.0.26] (75-166-225-82.hlrn.qwest.net. [75.166.225.82]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7dc9a7102b0sm1182475a34.0.2026.04.17.11.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 11:24:06 -0700 (PDT) From: Tom Tromey Date: Fri, 17 Apr 2026 12:24:05 -0600 Subject: [PATCH 3/6] Remove context_stack::depth MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260417-list-in-scope-v1-3-0deb050fc03d@adacore.com> References: <20260417-list-in-scope-v1-0-0deb050fc03d@adacore.com> In-Reply-To: <20260417-list-in-scope-v1-0-0deb050fc03d@adacore.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 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 context_stack::depth is never used, and I think it's not really useful, so this removes it. --- gdb/buildsym.c | 7 +++---- gdb/buildsym.h | 10 +++------- gdb/dwarf2/read.c | 4 ++-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/gdb/buildsym.c b/gdb/buildsym.c index f6cc5c153c2..6d719cb25a0 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -933,17 +933,16 @@ buildsym_compunit::augment_type_symtab () } } -/* Push a context block. Args are an identifying nesting level - (checkable when you pop it), and the starting PC address of this +/* Push a context block. VALU is the starting PC address of this context. */ context_stack & -buildsym_compunit::push_context (int desc, CORE_ADDR valu) +buildsym_compunit::push_context (CORE_ADDR valu) { context_stack &ctx = m_context_stack.emplace_back (std::move (m_local_symbols), m_local_using_directives, - m_pending_blocks, valu, desc); + m_pending_blocks, valu); m_local_using_directives = nullptr; diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 06d8d3c691f..70d22229f53 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -74,12 +74,11 @@ using subfile_up = std::unique_ptr; struct context_stack { context_stack (std::vector locals, using_direct *local_using_directives, - pending_block *old_blocks, CORE_ADDR start_addr, int depth) + pending_block *old_blocks, CORE_ADDR start_addr) : locals (std::move (locals)), local_using_directives (local_using_directives), old_blocks (old_blocks), - start_addr (start_addr), - depth (depth) + start_addr (start_addr) {} /* Outer locals at the time we entered. */ @@ -96,9 +95,6 @@ struct context_stack /* PC where this context starts. */ CORE_ADDR start_addr; - - /* For error-checking matching push/pop. */ - int depth; }; /* Flags associated with a linetable entry. */ @@ -245,7 +241,7 @@ struct buildsym_compunit m_producer = producer; } - context_stack &push_context (int desc, CORE_ADDR valu); + context_stack &push_context (CORE_ADDR valu); context_stack pop_context (); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index ebf7eeb673b..e1d70ea650d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7801,7 +7801,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } gdb_assert (cu->get_builder () != nullptr); - context_stack &ctx = cu->get_builder ()->push_context (0, lowpc); + context_stack &ctx = cu->get_builder ()->push_context (lowpc); ctx.name = new_symbol (die, read_type_die (die, cu), cu, templ_func); if (dwarf2_func_is_main_p (die, cu)) @@ -7953,7 +7953,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) lowpc = per_objfile->relocate (unrel_low); highpc = per_objfile->relocate (unrel_high); - cu->get_builder ()->push_context (0, lowpc); + cu->get_builder ()->push_context (lowpc); for (die_info *child_die : die->children ()) process_die (child_die, cu); -- 2.53.0