* how to examine the value in this compicated class
@ 2005-05-02 2:43 lin q
2005-05-02 4:02 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: lin q @ 2005-05-02 2:43 UTC (permalink / raw)
To: gdb
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?
Thanks?
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar  get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: how to examine the value in this compicated class
2005-05-02 2:43 how to examine the value in this compicated class lin q
@ 2005-05-02 4:02 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2005-05-02 4:02 UTC (permalink / raw)
To: lin q; +Cc: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-02 4:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 2:43 how to examine the value in this compicated class lin q
2005-05-02 4:02 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox