From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9834 invoked by alias); 14 Jan 2004 14:17:17 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 9827 invoked from network); 14 Jan 2004 14:17:17 -0000 Received: from unknown (HELO tisch.mail.mindspring.net) (207.69.200.157) by sources.redhat.com with SMTP; 14 Jan 2004 14:17:17 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by tisch.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1Aglpa-00047N-00; Wed, 14 Jan 2004 09:17:15 -0500 Received: by berman.michael-chastain.com (Postfix, from userid 502) id 72F934B104; Wed, 14 Jan 2004 09:17:30 -0500 (EST) To: marcel.lanz@ds9.ch Subject: Re: gdb, c++ & namespaces Cc: gdb@sources.redhat.com Message-Id: <20040114141730.72F934B104@berman.michael-chastain.com> Date: Wed, 14 Jan 2004 14:17:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2004-01/txt/msg00182.txt.bz2 Hi Marcel, The two debugging formats are: dwarf-2 and stabs+ (not dwarf and stabs). dwarf-2 is supported much better than stabs+ now, so try building your program with -gdwarf-2. > (netsilicon-gdb) print *dp > warning: can't find class named `tnos::net::DatagramPacket', as given by > C++ RTTI > $2 = {_vptr.DatagramPacket = 0xeffb0, ia = 0x206548, isa = 0x206690, > buffer = 0x206558 "", bufferLength = 0xff, length = 0xff} Try playing with the "set print object" flag: (gdb) set print object off (gdb) print *dp (gdb) set print object on (gdb) print *dp When "set print object" is off, gdb will print an object of the type of the pointer (we call this the "static type"). When "set print object" is on, gdb will print the type of the object in memory (we call this the "dynamic type". That warning is sometimes harmless if the data fields are what you expect. Are they? Michael C GDB QA Guy