From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29102 invoked by alias); 26 Jan 2011 18:57:02 -0000 Received: (qmail 29092 invoked by uid 22791); 26 Jan 2011 18:57:02 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Jan 2011 18:56:58 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id CE2D213426; Wed, 26 Jan 2011 10:56:55 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id BF62ECD94E; Wed, 26 Jan 2011 10:56:55 -0800 (PST) Message-ID: <4D406E77.9060706@vmware.com> Date: Wed, 26 Jan 2011 18:57:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: "Vyacheslav V. Yurkov" CC: "gdb@sourceware.org" Subject: Re: C++, can't see debug info for some classes References: <4D40424E.3040604@gmail.com> In-Reply-To: <4D40424E.3040604@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: 2011-01/txt/msg00110.txt.bz2 Vyacheslav V. Yurkov wrote: > Hi, > We use several static libraries in our project as our run-time. > To add debug info for a class X I just do: > g++ X.cpp -I../include -c -g -Wall -o X.o > ar rsu ../lib1.a X.o > That worked OK with any class from our library but at the moment > I have some issues with class X. I can't see its members in a debugger gdb. > gdb says that class X is . > I tried to do 'ptype X' in gdb and got the following: > No symbol "X" in current context. > I looked into it more, did objdump for X.o file and saw that > there is no address near the symbol which looks like my class X. > > I tried 3 different versions of g++ (4.3.x, 4.4.x, 4.5.x), tried > following parameters for gcc: -g3, -g2 -O0, -ggdb, -gstubs+. But nothing > helped. > My class X also doesn't use anonymous unions. > > Does anyone have an idea what is wrong with g++ or with my class X? > Thanks in advance. Was your class ever instantiated by the program? Sometimes if a class or struct type has no instances, its symbolic info is discarded.