From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5529 invoked by alias); 12 Nov 2010 19:36:48 -0000 Received: (qmail 5409 invoked by uid 22791); 12 Nov 2010 19:36:47 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Nov 2010 19:36:42 +0000 Received: from eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id oACK0Jv8005655 for ; Fri, 12 Nov 2010 14:00:33 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) with mapi; Fri, 12 Nov 2010 14:35:59 -0500 From: Marc Khouzam To: "'gdb@sourceware.org'" Date: Fri, 12 Nov 2010 19:36:00 -0000 Subject: Is it possible to access shadowed variables? Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00060.txt.bz2 Hi, I'm trying to figure out a way to deal with shadowed variables in Eclipse. But I can't find a way to access them from GDB. If I'm at line 3 of:=20=20 int a =3D 1; //line 1 { bool a =3D true; // line 3 } The only thing I found is to use -stack-list-locals 2 which will show me both variables with their types and both their values. -stack-list-locals 2 ^done,locals=3D[{name=3D"a",type=3D"bool",value=3D"true"}, {name=3D"a",type=3D"int",value=3D"1"}] Anything else I can do to tell GDB I want access to some shadowed variable? Note that floating variable objects don't help (I think) because I'm already at line 3 by the time I create the varObject, so it will point to the inner-most variable. Thanks for any suggestions. Marc