From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19214 invoked by alias); 26 Jan 2011 15:48:27 -0000 Received: (qmail 19201 invoked by uid 22791); 26 Jan 2011 15:48:26 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ew0-f41.google.com (HELO mail-ew0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Jan 2011 15:48:21 +0000 Received: by ewy27 with SMTP id 27so214149ewy.0 for ; Wed, 26 Jan 2011 07:48:18 -0800 (PST) Received: by 10.14.47.193 with SMTP id t41mr731492eeb.21.1296056898729; Wed, 26 Jan 2011 07:48:18 -0800 (PST) Received: from [192.168.1.3] ([93.157.232.12]) by mx.google.com with ESMTPS id t50sm12096168eeh.0.2011.01.26.07.48.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 07:48:18 -0800 (PST) Message-ID: <4D40424E.3040604@gmail.com> Date: Wed, 26 Jan 2011 15:48:00 -0000 From: "Vyacheslav V. Yurkov" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100401 Thunderbird/3.0.4 MIME-Version: 1.0 To: gdb@sourceware.org Subject: C++, can't see debug info for some classes 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/msg00109.txt.bz2 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. -- Yours sincerely, Vyacheslav V. Yurkov