From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id b5S7EGAhXGmqwy0AWB0awg (envelope-from ) for ; Mon, 05 Jan 2026 15:38:56 -0500 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=iYWjEbma; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 369141E0B6; Mon, 05 Jan 2026 15:38:56 -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.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 84B361E08D for ; Mon, 05 Jan 2026 15:38:55 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 13AF64BA2E28 for ; Mon, 5 Jan 2026 20:38:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13AF64BA2E28 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=iYWjEbma Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E50B14BA2E04 for ; Mon, 5 Jan 2026 20:38:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E50B14BA2E04 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 E50B14BA2E04 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=1767645510; cv=none; b=GqjGQRzIZX1HjyBoT2gmKygWKDipw1OOKZhXQk92F0hjzl6uUbe/70U/G+moAMos38JSWuXRVySJo35gKWSIBEudyFdxAmaAd/qB2ttF8LbWhSiTQcPss9SLZxcxu0Eaxnvv+LDCDrpDhKiO+OXIaD5kvT/fvlMzMM/Mu4Uqg80= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767645510; c=relaxed/simple; bh=1F+0+G+3F8Q3cCVgXVNomBrdQu3mhUeExnvLiaAqbAk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gM6oppuZpjtuXl/4vVwuowUwCC/bDSjQW/o+VhaOvQxqWi72WIrLUB1mxSZ6e9VGJ1G0CX4DKJR9FT/QlYQWdX8lb9RzXhtz5dRodkMt+/Ug8YMsRo21SLVqtJXBlUejLFxrTbz/Ws3Re6xEV/t9dl9R95u0deR9D7PkT27exxc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E50B14BA2E04 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 605KcNi5124843 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Jan 2026 15:38:27 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 605KcNi5124843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1767645508; bh=1/GhIB5VLg76EJ0YxgEQ+H5WC8cbhMWTKmrKW3MfRao=; h=From:To:Cc:Subject:Date:From; b=iYWjEbmaKKbahvyxZbaUCS49yaDpWqbJ9w7Bkwxi9eJTvabEshRrsYAwyY/0ZbEMV Wa4ZwQmoH2CN7OUnQQCPIaWcOOny2FCZRN3lNKqBGal72f4xciBwaiNm89tCObnTnY DHzNGztwu1q5Iv9NPw7WFOBw5Md0wNNzFWs8BkT7cPjdC2Se9Mdbj2q2Ad8OtGkOa2 DMiBVTLcd07wjOWCl5dPzkvPIjd+NFnoKKGqlb2P0CkVSdujQgOASemUrXo+8tpQGw qYJSJboAuX0s0ILqw9UIFC8M1yS63BVl5C0WLYturgymaVAPt6Q4nyqj3FGICIr0f+ XyzwrM+K8G7Mg== Received: by simark.ca (Postfix) id DB2051E08D; Mon, 05 Jan 2026 15:38:22 -0500 (EST) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: remove context_stack::static_link Date: Mon, 5 Jan 2026 15:38:18 -0500 Message-ID: <20260105203822.699896-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 5 Jan 2026 20:38:23 +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 From: Simon Marchi I don't think it's needed to record this information in the context_stack structure. The only user is the DWARF reader, where it can very well be a local variable. Change-Id: I6e33affbf03f11c0d0ab60067f169137fde1c994 --- gdb/buildsym.h | 4 ---- gdb/dwarf2/read.c | 11 +++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gdb/buildsym.h b/gdb/buildsym.h index ff1c2a075fcc..7ca5e57c7f4a 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -94,10 +94,6 @@ struct context_stack /* Name of function, if any, defining context. */ symbol *name = nullptr; - /* Expression that computes the frame base of the lexically enclosing - function, if any. NULL otherwise. */ - dynamic_prop *static_link = nullptr; - /* PC where this context starts. */ CORE_ADDR start_addr; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4b706f654e0d..8c3bc156fc2f 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -8600,14 +8600,12 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) dwarf2_symbol_mark_computed (attr, ctx.name, cu, 1); /* If there is a location for the static link, record it. */ - ctx.static_link = NULL; + dynamic_prop *static_link = nullptr; attr = dwarf2_attr (die, DW_AT_static_link, cu); if (attr != nullptr) { - ctx.static_link - = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); - attr_to_dynamic_prop (attr, die, cu, ctx.static_link, - cu->addr_type ()); + static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); + attr_to_dynamic_prop (attr, die, cu, static_link, cu->addr_type ()); } cu->list_in_scope = &cu->get_builder ()->get_local_symbols (); @@ -8650,9 +8648,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } struct context_stack cstk = cu->get_builder ()->pop_context (); + /* Make a block for the local symbols within. */ block = cu->get_builder ()->finish_block (cstk.name, cstk.old_blocks, - cstk.static_link, lowpc, highpc); + static_link, lowpc, highpc); /* For C++, set the block's scope. */ if ((cu->lang () == language_cplus base-commit: 1819e42280cc89754db92a3416392b82794989a2 -- 2.52.0