From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23716 invoked by alias); 14 Nov 2008 20:32:30 -0000 Received: (qmail 23610 invoked by uid 22791); 14 Nov 2008 20:32:18 -0000 X-Spam-Check-By: sourceware.org Received: from ey-out-1920.google.com (HELO ey-out-1920.google.com) (74.125.78.149) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 20:31:14 +0000 Received: by ey-out-1920.google.com with SMTP id 4so674419eyg.24 for ; Fri, 14 Nov 2008 12:31:11 -0800 (PST) Received: by 10.86.84.5 with SMTP id h5mr842297fgb.10.1226694671515; Fri, 14 Nov 2008 12:31:11 -0800 (PST) Received: by 10.86.25.10 with HTTP; Fri, 14 Nov 2008 12:31:11 -0800 (PST) Message-ID: <8440576b0811141231u55336182p8e16563889f4143e@mail.gmail.com> Date: Fri, 14 Nov 2008 20:32:00 -0000 From: "Koffee Lue" To: gdb Subject: Bug? GDB can't display c++ c'tor local variable. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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: 2008-11/txt/msg00117.txt.bz2 Hi, I found that GDB can't display local variables in a c++ constructor. Please see the testing code below. When I stepped into the c'tor, and typed ''info lo'', gdb responded "No locals.", however `tmp' is a local with type int. I searched on the web and somebody said it's a bug of gcc rather than gdb. But that's for gcc 3.x years ago. (see: http://gcc.gnu.org/ml/gcc-bugs/2007-08/msg00727.html) Any hint??? Thanks! Here's my system: ---------------------------------- Distributor ID: Ubuntu Description: Ubuntu 8.04.1 Release: 8.04 Codename: hardy g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". ----- testing code ------ 1 #include 2 3 using namespace std; 4 5 class A { 6 public: 7 int a; 8 A(); 9 }; 10 11 A::A() 12 { 13 int tmp = 5; 14 a = tmp; 15 cout << "a= "<