This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to examine the value in this compicated class


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]