From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id q3h7G4JuTmWuHgMAWB0awg (envelope-from ) for ; Fri, 10 Nov 2023 12:55:14 -0500 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=FBrtbCUY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 669671E0C1; Fri, 10 Nov 2023 12:55:14 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 1EF1D1E00F for ; Fri, 10 Nov 2023 12:55:12 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DF2B3858415 for ; Fri, 10 Nov 2023 17:55:11 +0000 (GMT) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by sourceware.org (Postfix) with ESMTPS id 06E893858D32 for ; Fri, 10 Nov 2023 17:54:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06E893858D32 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 06E893858D32 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=134.134.136.65 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699638900; cv=fail; b=RbV5iH7PcfXkp+rBaMJLHYt7QdFK0cgmD3TP+0aiAmYmraqQ1yBQX+USXH//UBV3JmkRrh5TSLlefPz7KIlcakscdzwwn6/UL23vrkrAbWgGOzTxMbOpaM5N8fSD9pcmVBQZwTKBC0bpZlPfdre9T+b4XX5tm2wPnlqqPZHE52c= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699638900; c=relaxed/simple; bh=qWLbMpMDMqcJbDjYBwemoO2dmBDRNpEi7GKKayNTEyI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Z+mvyIgI0FC7iIS8RBX2FqYaz5DF/6Mo6vipFg/NM6c0JmrzjJuTylQOpxAM+h23SwZb4rGg8OLguQ2joqpMK3w3Nr6QeGrht0ogqasohvzjpYa5+diAhjwCa/6uNq3FwAOMWR1Amp64ajCRn1D5oniwH2aNpe5V0FG3V9YP1iQ= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699638898; x=1731174898; h=from:to:cc:subject:date:message-id:mime-version; bh=qWLbMpMDMqcJbDjYBwemoO2dmBDRNpEi7GKKayNTEyI=; b=FBrtbCUYxGgh1BKxShYffy1ag3HnNw9MyoQO8haByMXZ8RoXe9aD6bo/ nbMbhUoXsetMdHe4fS73+V0pna902rvsnOrsd+R/TsIwq1CKlN7oxB8Ys nA1cvDvNi60RSqAU77pdzntnKiK2/tkFJq7Q3u+Aott08FKfGYyoW8FJX hNHblBpSMMFgE2oUgB2FP2x3EaZHTncMz1plj8vOCLwwGP5HJ8EUAXxG+ HboiIj8sQdbot1Pu73kI74IKHsfP6Oni6p8z0kgjwHv4A6mP9sirhNeGm OP8bLI4JfEAww+hqgTlJF8HqZqKyhlj1xpU6P17IgS/0eilMcQMqQojng A==; X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="394120368" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208,217";a="394120368" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2023 09:54:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="1095240438" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208,217";a="1095240438" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Nov 2023 09:54:56 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 10 Nov 2023 09:54:55 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 10 Nov 2023 09:54:55 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 10 Nov 2023 09:54:55 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 10 Nov 2023 09:54:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTuWNWjs/zYtDtbNsVh6DNyIms024RtM4fGx0htwhZkMDTiZymz5VNb0T5/hY5NKksjYujcB8fEwvDOQwzTt6Ug+PrS/ul3d04icfX5rals+Q9TPCGF8SZLupDYGZqmk0mCTw/1YmyIfN5Ifj7FF8fazeVXeEED7f3VNjtILv08JsUs3CC6k/cPC0eOWPgkAbWyYYqTwgpebspu1Ph9Mb4K33eQBJkLbv/Nf4t/d6T7oRJnGDcw9kyBXS2PN4y9RR7WVTzoQmXpisVC7fIKt8AnBgpNBJBudEuvI6RaSFj+JCTqJoreugT8vA5rPCLGTWT38TqDlVhn84DK6zG2Oww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ceWAeK0RHRMKXoLNjU70mGnxMhmnV0bMFEPPRjTKUz0=; b=UXOXSuLz7I2V3z5+4O6WqjZG4fzR2Sz/WhpwkZKplD6c9L5y/+cK9cC4EZbcRbqQiBWjzXHEr73jFiuLUh6dU0smDh4wB9jDli6x0tFVbOFAj/VUyv/FA4vD3gr/LHV5FlB3ioXap8/B3qAPOZSUr5yBXA4xDLWR6OUaplE4CyrCo3oBqEehFmT62WO4ZHh+XzOdizVxXbf295f3134uSlBfjXM6UZ7+SVHeARVGuIup1N1Hehpgrebh4ywNcr5oixCRmez0PrI+x1RV0HmrdFaWwHO3F0SZDkgmKP+WGspioQTL8viRlP+/cNFb7mcw+wgDUaCqx10+I2Yj8WKaPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA2PR11MB4779.namprd11.prod.outlook.com (2603:10b6:806:11a::7) by CY8PR11MB7084.namprd11.prod.outlook.com (2603:10b6:930:50::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Fri, 10 Nov 2023 17:54:53 +0000 Received: from SA2PR11MB4779.namprd11.prod.outlook.com ([fe80::cae2:c0ce:a277:2433]) by SA2PR11MB4779.namprd11.prod.outlook.com ([fe80::cae2:c0ce:a277:2433%5]) with mapi id 15.20.6977.018; Fri, 10 Nov 2023 17:54:53 +0000 From: "Sargsyan, Eduard" To: "gdb-patches@sourceware.org" CC: "Aktemur, Tankut Baris" , "Metzger, Markus T" , "Schimpe, Christina" Subject: Filtering shadowed variables in info local Thread-Topic: Filtering shadowed variables in info local Thread-Index: AdoT+0WHTDQRoZXUQYmws3PB49oDSw== Date: Fri, 10 Nov 2023 17:54:53 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA2PR11MB4779:EE_|CY8PR11MB7084:EE_ x-ms-office365-filtering-correlation-id: ccc0ff9f-308d-4878-6c51-08dbe2162497 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5GMmUJiLf/Fr+Mmvxxuzf7E8t5H/xH7dzUmv4x+0UhjUprAsLqb/+B7RxhqT02vd7GndFmpLWYDQvN9U1MqCBZjtYDecS4QmaUqAF9xmyuv6WEKqmdt/uTX+s+ltoMjnqV6JLeZyjAPn8LX/hEfd4zzbHC/KOwWmytCp3m033RjI3Ugtq2Ldd11M3TwyGFd/kni27woQSZdOnAIYHo/+qxHJbwRoc17qGNhmX2YOFjkFnO83MrsSrPmiygwtMA7D6p9NoCmSvgym9baNcPFDax+VXdb/k1GDzwJDhXoBV1GYbIbJOnIoDnwofi8Q8dCxTEEHQGxq3s2gGBn2c/KrnrGJ2HjDPU9yrB8ankggpRKNe5iNMlOyGJwcPcPUW+ABCpLhabPxPr/droD91rusm/CqDvPVXiv9O54tdMBKcK6q7tKPvuoJjcsQVS5HH/04cGnYcMlswOj6Rj8/uD4TKoOSPsOsIVUptSxRScWXHUpP3eA/hy2ybz4zDxPUwwT2ZwEwRdvtdfmPgpmuCuLYTziZEKAJyxftWJTlsIRtLmHRYyPcUW9IXXfUsw6TmiKi1QrXlNnuXgqHQtpe14mI+M1dhiAD9nvyDRgYwgg1vKFNUA7QFV9FrD2NWIv4JBdz7ctJGFRX+fAInQT7JDt8wQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB4779.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(346002)(39860400002)(376002)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(82960400001)(86362001)(38100700002)(166002)(55016003)(38070700009)(122000001)(33656002)(2906002)(6506007)(71200400001)(966005)(478600001)(7696005)(5660300002)(64756008)(9686003)(107886003)(26005)(66446008)(21615005)(8676002)(4326008)(9326002)(52536014)(8936002)(316002)(6916009)(54906003)(76116006)(66946007)(66556008)(41300700001)(66476007)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WQRtz3Ri6+1rt7PLcedf2R5aEQ2xIRfXKU1f1PLdCxWyrgHnDzJ69tmwWJeR?= =?us-ascii?Q?t0bVIxoIY/lkxHEIj8a7nXCI4t/MRgiAQLpGxzaWuydwjuTaiMh5WGlkhlZP?= =?us-ascii?Q?0WNbd9nLyc2aBoMCeoMpGim+UpenxtA/M6ItEStrqPYpgZr3T32XyT7qaBeL?= =?us-ascii?Q?MzwqWDaXotNd58ZSWjfW3VG1RtPAo3UoHbaS/fvAlBy425ad9s7b0xI4vidx?= =?us-ascii?Q?GUoznzpURr5tIjRT+sClzU7LcopnNV97JFgCynnUScoVFmAN4RefJoBEOg1F?= =?us-ascii?Q?TxKYypsUDd3dZeV+oz2Mi1US04JPniChzucN/adjRPWZ6Wjb+DJzREwkdOzl?= =?us-ascii?Q?LylR9kU8/uti33jwE803ihabk7yt2Ma+OFMJ+spSnV5sCBXqnBhf5owArZm5?= =?us-ascii?Q?ljZoUahDZCK/Qg24XB9H7/sQD/cKyDud5RMqBv8XRfROJ/qz0OG/MWuwCoPF?= =?us-ascii?Q?43MWisLojdJPJDlA4tnfbdBGuH2ExQ5csBxTB50UFKD0VdqQ2Z8lxn3Wsr7X?= =?us-ascii?Q?mgfG0TVUIJqO7pY/IQc+XbctSlBD3PAOdqGXr1BOnvkNET25CL+w3M9y/bdm?= =?us-ascii?Q?6e0PX+YSsCtJE7JHs6cRRA8HtLXFhmVBVI+Lw+5STfAZHKCbfdSef/qpRrsP?= =?us-ascii?Q?uwpnmm/pUA6aA7X9DW39822bTIkBcbR6XbT16Y929HVdKW2vW6S7FZ7oozg6?= =?us-ascii?Q?wWb43WNRkDEEZAJdUlRMLKRVe91RFkIrmrVmPJ9fp5TIJSnD5xGvTOHuTT7B?= =?us-ascii?Q?XBqakfJe0wflXQuQXAMZm0OxW8sq0gnt8Xd7gyA0o+j0Yo6xzn5g7ynHGcT1?= =?us-ascii?Q?RGnWGRDa/iqsJjuQHR3kIklzJ/ORoZS5DUQJC2j0cpnTsnxQwg+kSP+r5zdz?= =?us-ascii?Q?ld/VbciNEU4rUN5s0FUTMgwilWvPBj80yaaZbDBc94roFxxrz8r26cLVlwl4?= =?us-ascii?Q?3KfehKqBcZBX8vCq+wCmHpwfWci41zxQ3NxQDIO/Ta/Bsm0oQZxvbfvtdGPT?= =?us-ascii?Q?d0C5WGxg60b99+TAwL67hyb89kcOQ1b5rY14GpU2Ui0I2kdGFa8UCveCzeog?= =?us-ascii?Q?QsbN02gla2PbN8SBwhbiq98PTdgHGkz/BK3s/zDV7I6yAjo1/fNvxmhzW8Gh?= =?us-ascii?Q?bYyfR7F1R0mTRZww5TDWvB/LOvPvkoBlwNIDKgLHRii8NYJynNP8+mdvqZRF?= =?us-ascii?Q?sB3D4s5yhoqfnETZVMW3JWcJVUvz5EO4DvCmqXFDbrbvsRI1GrAmQJvr5pvO?= =?us-ascii?Q?2WmK8ZpTjZWgUMBaV/rEK1kDFmADsb1RF7JHNvhm8FoBPP/VpIjP1yXdqBQ3?= =?us-ascii?Q?YQaKRys28WL3fGJgGsLLV+0oDtBDpf47nPHRUXH8AXiyTF/iqYnhgFLdfRt+?= =?us-ascii?Q?GzGxP+YZtUwRqudF3n47+7TyIb0e+xKM6c3pt0HCerZ1fZecfqrs+fQrSq3z?= =?us-ascii?Q?ufLk6j/ItyhORtxYzrsg1xtBicVzkxX6pf92CSxuYsw5QeWUbz0Q/P8FDLjG?= =?us-ascii?Q?IJlpt06FQ+lqZK6u2w3zO1RfP1sG4Uc50LIhDtTWfY5bCn2f/mS+hNP5xhz8?= =?us-ascii?Q?3W0DyzRpFl+vxF6k3hYLgGRIMxfF9UbTbhDh4V7N?= Content-Type: multipart/alternative; boundary="_000_SA2PR11MB47795DF0FA8F02C6B75036B5E0AEASA2PR11MB4779namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB4779.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccc0ff9f-308d-4878-6c51-08dbe2162497 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 17:54:53.3744 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RdVPvG8SAvD6eJH+NP79JIAS93ZLiZd0F8flA6FjpMv5UAkTJ2+/1thiF3hrtXbTQmqowMdPO8EWr9tylSFb/NCbGNy1ye9vOyc4xfKrjuQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7084 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 --_000_SA2PR11MB47795DF0FA8F02C6B75036B5E0AEASA2PR11MB4779namp_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, After https://sourceware.org/pipermail/gdb-patches/2021-June/180478.html and https://sourceware.org/pipermail/gdb-patches/2022-January/184819.html GDB prints "" if variable has been marked as shad= owed. But user might not be interested in seeing any shadowed variables. For example, this code: 1 int num =3D 1; 2 int 3 main () 4 { 5 const char *str =3D "main"; 6 int num =3D 3; 7 { 8 const char *str =3D "nested"; 9 int num =3D 5; 10 num =3D 0; // break here 11 } 12 return num; 13 } Brings GDB to (when stopped at line 10): (gdb) info locals str =3D 0x555555556009 "nested" num =3D 5 str =3D 0x555555556004 "main" num =3D 3 Prints both shadowed and local variables "str" and "num", but does not print global accessible variable "num". (gdb) print num $1 =3D 5 (gdb) print ::num $2 =3D 1 Setting value to local variable "num" works as expected: (gdb) set num =3D 7 (gdb) info locals str =3D 0x555555556009 "nested" num =3D 7 str =3D 0x555555556004 "main" num =3D 3 In C++ shadowed variable is not accessible, to there is no way to change va= lue of variable "num" declared at line 5. So only local and global variables c= an be modified: (gdb) set ::num =3D 9 (gdb) print num $3 =3D 7 (gdb) print ::num $4 =3D 9 I'm not sure if printing shadowed variables "num" and "str" are useful in t= he use case described above. Maybe adding a setting to filter out shadowed variables makes sense (by default the setting will be disabled). Example: (gdb) info locals str =3D 0x555555556009 "nested" num =3D 7 str =3D 0x555555556004 "main" num =3D 3 (gdb) set print shadowed off (gdb) info locals str =3D 0x555555556009 "nested" num =3D 7 (gdb) set print shadowed on (gdb) info locals str =3D 0x555555556009 "nested" num =3D 7 str =3D 0x555555556004 "main" num =3D 3 What are your thoughts? - Eduard Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 --_000_SA2PR11MB47795DF0FA8F02C6B75036B5E0AEASA2PR11MB4779namp_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

Hi,

 

After https://sourceware.org/pipermail/gdb-patches/2021-June/180478.html=

and https://sourceware.org/pipermail/gdb-patches/2022-January/184819.html

GDB prints "<shadowed: decl at line 5>&qu= ot; if variable has been marked as shadowed.

But user might not be interested in seeing any shado= wed variables.

 

For example, this code:

 

     1 int num =3D 1;=

     2 int

     3 main ()

     4  {

     5    const c= har *str =3D "main";

     6    int num= =3D 3;

     7    {<= /o:p>

     8    &n= bsp;  const char *str =3D "nested";

     9    &n= bsp;  int num =3D 5;

    10      = num =3D 0; //  break here

    11    }=

    12    return num;<= o:p>

    13  }

 

Brings GDB to (when stopped at line 10):<= /p>

 

  (gdb) info locals

  str =3D 0x555555556009 "nested"= ;

  num =3D 5

  str =3D 0x555555556004 "main" =     <shadowed: decl at line 5>

  num =3D 3 <shadowed: decl at line 6>

 

Prints both shadowed and local variables "str&q= uot; and "num", but does not print

global accessible variable "num".

 

  (gdb) print num

  $1 =3D 5

  (gdb) print ::num

  $2 =3D 1

 

Setting value to local variable "num" work= s as expected:

  (gdb) set num =3D 7

  (gdb) info locals

  str =3D 0x555555556009 "nested"

  num =3D 7

  str =3D 0x555555556004 "main" =     <shadowed: decl at line 5>

  num =3D 3 <shadowed: decl at line 6>

 

In C++ shadowed variable is not accessible, to there= is no way to change value

of variable "num" declared at line 5. = ; So only local and global variables can

be modified:

 

  (gdb) set ::num =3D 9

  (gdb) print num

  $3 =3D 7

  (gdb) print ::num

  $4 =3D 9

 

I'm not sure if printing shadowed variables "nu= m" and "str" are useful in the

use case described above.  Maybe adding a setti= ng to filter out shadowed

variables makes sense (by default the setting will b= e disabled).

 

Example:

 

  (gdb) info locals

  str =3D 0x555555556009 "nested"

  num =3D 7

  str =3D 0x555555556004 "main" =     <shadowed: decl at line 5>

  num =3D 3 <shadowed: decl at line 6>

  (gdb) set print shadowed off

  (gdb) info locals

  str =3D 0x555555556009 "nested"= ;

  num =3D 7

  (gdb) set print shadowed on

  (gdb) info locals

  str =3D 0x555555556009 "nested"= ;

  num =3D 7

  str =3D 0x555555556004 "main" =     <shadowed: decl at line 5>

  num =3D 3 <shadowed: decl at line 6>

 

What are your thoughts?

 

- Eduard

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubi= berg, Germany
Tel: +49 89 99 8853-0, www= .intel.de
Managing Directors: Christin Eisenschmid, Sharon Heck, Tif= fany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
R= egistered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 1= 86928

--_000_SA2PR11MB47795DF0FA8F02C6B75036B5E0AEASA2PR11MB4779namp_--