From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8933 invoked by alias); 8 May 2008 19:15:21 -0000 Received: (qmail 8920 invoked by uid 22791); 8 May 2008 19:15:20 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 May 2008 19:15:02 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id C10333BFE5; Thu, 8 May 2008 12:15:00 -0700 (PDT) Subject: Re: Question on typedefs of anonymous structs in G++ From: Michael Snyder To: Hilfinger@adacore.com Cc: gdb@sourceware.org In-Reply-To: <20080507090045.51A1048CC44@nile.gnat.com> References: <20080507090045.51A1048CC44@nile.gnat.com> Content-Type: text/plain Date: Thu, 08 May 2008 19:15:00 -0000 Message-Id: <1210274100.4615.495.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit 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-05/txt/msg00070.txt.bz2 On Wed, 2008-05-07 at 05:00 -0400, Paul Hilfinger wrote: > Using g++ 4.1 on Linux (at least), I observe that a type such as > > typedef struct { > ... > } Foo; > > produces no trace of debugging information about Foo. Serves one > right for writing a C-style definition of Foo in a C++ program, to be > sure, but G++ used to include Foo in the debugging data. Does anyone > here happen to know the story behind the change? Thanks. Did you actually declare an object of the type? And use the object, so that it couldn't be optimized away? Without an instance of a type, G++ will likely optimize the debug info for the type away.