From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12424 invoked by alias); 2 Jun 2011 18:43:26 -0000 Received: (qmail 12416 invoked by uid 22791); 2 Jun 2011 18:43:26 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Jun 2011 18:43:09 +0000 Received: from kpbe20.cbf.corp.google.com (kpbe20.cbf.corp.google.com [172.25.105.84]) by smtp-out.google.com with ESMTP id p52Ih7po012253 for ; Thu, 2 Jun 2011 11:43:08 -0700 Received: from gyb11 (gyb11.prod.google.com [10.243.49.75]) by kpbe20.cbf.corp.google.com with ESMTP id p52IgsIb006892 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 2 Jun 2011 11:43:06 -0700 Received: by gyb11 with SMTP id 11so531033gyb.29 for ; Thu, 02 Jun 2011 11:43:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.9.20 with SMTP id m20mr718711ani.46.1307040185766; Thu, 02 Jun 2011 11:43:05 -0700 (PDT) Received: by 10.100.93.20 with HTTP; Thu, 2 Jun 2011 11:43:05 -0700 (PDT) In-Reply-To: <838vtkf7lx.fsf@gnu.org> References: <838vtkf7lx.fsf@gnu.org> Date: Thu, 02 Jun 2011 18:43:00 -0000 Message-ID: Subject: Re: watchpoint on variable in function scope From: Sterling Augustine To: Eli Zaretskii Cc: Tom Tromey , niko.sams@gmail.com, gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true 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: 2011-06/txt/msg00018.txt.bz2 Tom's test case works fine for me if I compile it as a C program. However, it fails if I compile it as a C++ program. (Using gcc 4.4.3.) Looking at the assembly, the C code names the static "i.1591", but the C++ code uses "_ZZ3foovE1i". So this seems to be a C++ name look up failure. Not sure it how should work. $ gcc ~/bar.c -g $ ./gdb ./a.out GNU gdb (GDB) 7.2.90.20110513-cvs ... (gdb) watch foo::i Watchpoint 1: foo::i (gdb) run Starting program: ./a.out Hardware watchpoint 1: foo::i Old value = 0 New value = 1 foo () at /home/saugustine/bar.c:4 4 }