From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7081 invoked by alias); 2 May 2005 04:02:46 -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 7068 invoked from network); 2 May 2005 04:02:43 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 2 May 2005 04:02:43 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DSS8o-0002ak-VO; Mon, 02 May 2005 00:02:43 -0400 Date: Mon, 02 May 2005 04:02:00 -0000 From: Daniel Jacobowitz To: lin q Cc: gdb@sources.redhat.com Subject: Re: how to examine the value in this compicated class Message-ID: <20050502040242.GA9943@nevyn.them.org> Mail-Followup-To: lin q , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00011.txt.bz2 On Sun, May 01, 2005 at 08:43:48PM -0600, lin q wrote: > Hi, > I am new to gdb, in using print and display commands I can easily examine > the value of simple data type. But how about this one: > > class C2; > > class C1{ > char* s1; > C2* c2; > }; > > class C2{ > char* s2; > }; > > Let's say in the code there is a variable, c1, whose type is C1*. Then in > GDB how I can check the value of c1->c2->s2? Exactly like that. "print c1->c2->s2". You may want to take a look at the GDB documentation. -- Daniel Jacobowitz CodeSourcery, LLC