From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YhD8JUSSTmq7oiwAWB0awg (envelope-from ) for ; Wed, 08 Jul 2026 14:09:08 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IQ6nKh15; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8548E1E024; Wed, 08 Jul 2026 14:09:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 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 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 459A41E024 for ; Wed, 08 Jul 2026 14:09:07 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2B7C4BA2E22 for ; Wed, 8 Jul 2026 18:09:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2B7C4BA2E22 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IQ6nKh15 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by sourceware.org (Postfix) with ESMTPS id 9452C4BA5434 for ; Wed, 8 Jul 2026 18:08:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9452C4BA5434 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9452C4BA5434 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783534121; cv=none; b=pzHAWjOLSxOmItGBS8W7GdZTe8ywiWA4GJYPTccI5G2cdauxoekTrC+xwzOqU0PhDVEkaKHGlM1lSmJ6iPuTIpUHP8t2XURtkbVMArx0YbDWnZlXJ806TLGG8+nCcDsUVD2pATU9E30oX8aFZhB3wP2N/+4V9+aom9yy/yVhsio= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783534121; c=relaxed/simple; bh=uuEP9d5PU0q1HWj6/fvEyuyMR7OAhdGPu4rG8nuw0Jw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=b6P+rna+yDpS5lG7vj9RdfjoOEmF2fWz65/ymejZKAdQeDsJZt2p4ThqdQEEy4jXBSlHTLpU5U4VN1fExlHlN3YcEIuLjR1WF0wzXRzGUXSH/1d2w8ixVFXEhZPaJkVqeeYGXSo3bRR1vqr1IKoGwBXK8Hm4KvfcldEvqaLdrVQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IQ6nKh15 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9452C4BA5434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783534121; x=1815070121; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=uuEP9d5PU0q1HWj6/fvEyuyMR7OAhdGPu4rG8nuw0Jw=; b=IQ6nKh15h8exw4Rmnlb1BYRP7zX9hpI7HlzSc2VlxjhWxmyoIlN97ZED Zf1kA3G7uTAL2hMoHMVFJBgbo/8XnhmQNwApbNd9sLUgiOQAqNJn1Wjjb 7aCGg8QBSTEFTU8AleLVrj+M4qls8tU9rdPtn5xZJwzrfYJ5ldQ6QF2pU LZ2NmAnNQsLB621xbgTSXkiOSrHZZTi2qh7LNh/Pwe31O+zuyrFuB/FJT 4+JRRvM2u356K4B0wmUaki55S3D8ry08HSOULsFmfEZ1R0O10so+EueFE go6dgdwFgxQaTnroYnsj3nmGnSL2XNtBS66uv7eP/OM/+YFEZAIkpvpZJ w==; X-CSE-ConnectionGUID: CeI3XctXT2K5Qn0OqGZ4pw== X-CSE-MsgGUID: a5pXEJtNTSmg4UrJRJS7sQ== X-IronPort-AV: E=McAfee;i="6800,10657,11841"; a="107002498" X-IronPort-AV: E=Sophos;i="6.25,153,1779174000"; d="scan'208";a="107002498" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2026 11:08:40 -0700 X-CSE-ConnectionGUID: gQ16v93YTSi2paywdvLsgA== X-CSE-MsgGUID: 7z+Jn1xTSfuUxW9XjQxGxA== X-ExtLoop1: 1 Received: from srabe-mobl.ger.corp.intel.com (HELO localhost) ([10.245.80.174]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2026 11:08:36 -0700 From: Abdul Basit Ijaz To: gdb-patches@sourceware.org Cc: pedro@palves.net, philippe.waroquiers@skynet.be, aburgess@redhat.com, christina.schimpe@intel.com, lsix@lancelotsix.com, eliz@gnu.org, abdul.b.ijaz@intel.com, guinevere@redhat.com Subject: [PATCH v13 0/2] add annotation in 'info locals' command for variables shadowing case Date: Wed, 8 Jul 2026 20:08:03 +0200 Message-Id: <20260708180805.207722-1-abdul.b.ijaz@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 Hi All, For the variable shadowing case, these patches add the annotation "shadowed" and location information to the shadowed variables so that it is easier for the end user to identify which variable was shadowed. Patch #1 updates "info locals" command Path #2 is for the mi commands '-stack-list-locals' and '-stack-list-variables'. Last V12 Series: https://sourceware.org/pipermail/gdb-patches/2025-December/223219.html V11 Series: https://sourceware.org/pipermail/gdb-patches/2025-November/223002.html V10 Series: https://sourceware.org/pipermail/gdb-patches/2025-April/217019.html V9 Series: https://sourceware.org/pipermail/gdb-patches/2025-March/216590.html V8 Series: https://sourceware.org/pipermail/gdb-patches/2024-December/214263.html Documentation in V7 Series was already approved by Eli: https://sourceware.org/pipermail/gdb-patches/2024-October/212228.html https://sourceware.org/pipermail/gdb-patches/2024-October/212229.html Patch#1 V6 was Reviewed-by Larsen: https://sourceware.org/pipermail/gdb-patches/2024-January/205923.html Patch#2 V2 was Tested-by Larsen: https://sourceware.org/pipermail/gdb-patches/2024-January/205922.html Changes since V12: * Rebase the patch and a guard for a file_name nullable passed to styled_string was required and added now accordingly. * Update copyright years for new files and some minor fixes from last feedback. Changes since V11: * This V11 series fixes the feedback from Eli in documentation and still waiting for the feeback from upstream community regarding use of annotation for the non-shadowed variables also. See: https://sourceware.org/pipermail/gdb-patches/2025-November/223011.html https://sourceware.org/pipermail/gdb-patches/2025-November/223012.html Testing is done for unix/m32/native-gdbserver configurations and no issue is seen. Thanks & Best Rergards Abdul Basit Ijaz, Abdul B (2): gdb: add annotation in 'info locals' command for variables shadowing case gdb: add shadowed field in '-stack-list-locals/variables' mi commands gdb/NEWS | 8 + gdb/c-typeprint.c | 3 +- gdb/doc/gdb.texinfo | 47 ++++++ gdb/language.c | 20 +++ gdb/language.h | 19 +++ gdb/mi/mi-cmd-stack.c | 129 +++++++++++----- gdb/printcmd.c | 38 ++++- gdb/stack.c | 115 +++++++++++++- gdb/stack.h | 14 ++ gdb/testsuite/gdb.ada/var_shadowing.exp | 39 +++++ .../gdb.ada/var_shadowing/var_shadowing.adb | 30 ++++ gdb/testsuite/gdb.base/var-shadowing.c | 51 +++++++ gdb/testsuite/gdb.base/var-shadowing.exp | 92 ++++++++++++ gdb/testsuite/gdb.base/var-shadowing2.c | 16 ++ gdb/testsuite/gdb.mi/mi-var-shadowing.c | 50 +++++++ gdb/testsuite/gdb.mi/mi-var-shadowing.exp | 141 ++++++++++++++++++ gdb/testsuite/gdb.opt/inline-locals.exp | 21 ++- gdb/testsuite/gdb.rust/var_reuse.exp | 36 +++++ gdb/testsuite/gdb.rust/var_reuse.rs | 20 +++ gdb/value.h | 26 +++- 20 files changed, 857 insertions(+), 58 deletions(-) create mode 100644 gdb/testsuite/gdb.ada/var_shadowing.exp create mode 100644 gdb/testsuite/gdb.ada/var_shadowing/var_shadowing.adb create mode 100755 gdb/testsuite/gdb.base/var-shadowing.c create mode 100755 gdb/testsuite/gdb.base/var-shadowing.exp create mode 100644 gdb/testsuite/gdb.base/var-shadowing2.c create mode 100644 gdb/testsuite/gdb.mi/mi-var-shadowing.c create mode 100644 gdb/testsuite/gdb.mi/mi-var-shadowing.exp create mode 100755 gdb/testsuite/gdb.rust/var_reuse.exp create mode 100755 gdb/testsuite/gdb.rust/var_reuse.rs -- 2.34.1 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928