From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13937 invoked by alias); 26 Aug 2008 16:29:05 -0000 Received: (qmail 13928 invoked by uid 22791); 26 Aug 2008 16:29:04 -0000 X-Spam-Check-By: sourceware.org Received: from relay-pt1.poste.it (HELO relay-pt1.poste.it) (62.241.4.164) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Aug 2008 16:24:13 +0000 Received: from geppetto.reilabs.com (212.123.91.176) by relay-pt1.poste.it (7.3.122) (authenticated as stefano.sabatini-lala@poste.it) id 48B347C800005B65 for gdb@sources.redhat.com; Tue, 26 Aug 2008 18:23:50 +0200 Received: from stefano by geppetto.reilabs.com with local (Exim 4.67) (envelope-from ) id 1KY1Jj-00072s-FR for gdb@sources.redhat.com; Tue, 26 Aug 2008 18:22:51 +0200 Date: Wed, 27 Aug 2008 16:04:00 -0000 From: Stefano Sabatini To: gdb Mailing List Subject: C++ debugging pain Message-ID: <20080826162251.GA24398@geppetto> Mail-Followup-To: gdb Mailing List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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-08/txt/msg00277.txt.bz2 Hi all, I'm writing here since google didn't help with the problems I'm facing. I'm currently writing a C++ app, and I'm using gdb to debug its code (code compiled by gcc/g++), and facing many problems which make the use of gdb quite problematic not to say frustrating sometimes. Common problems which I'm faced are mainly: * incomplete types problems when trying to print object with p. I today followed a tip and added -femit-class-debug-always and apparently I got that problem fixed. * "class X does not have any method named Y": this happens with virtual methods defined in a parent class rather than in the class of the instance debugged * "Cannot resolve method (null)X to any overloaded instance": this happen when I try to invoke a method on some object I've been already advised by Daniel Jacobowitz (thanks Daniel) that it could depend on the method invoked being inlined. I'll eventually try to provide test cases for each one of these problems, for the moment I would just like to know if: * these are common problems, or are just the way the universe is conjuring for telling me: "I don't like you" ;-) * these are to be considered gcc/gdb bugs, or are simply unavoidable problems * there is some magic incantation (e.g. gcc/gdb options) I could or should use in order to avoid them. Many thanks in advance. Regards.