Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » how do I look at class variables in debug mode?
how do I look at class variables in debug mode? [message #760474] Fri, 02 December 2011 14:00 Go to next message
Arman  is currently offline Arman Friend
Messages: 15
Registered: November 2011
Junior Member
I have a class which contains a pointer to a vector, the content of which I'd like to see, how can I do this in debug mode? I'm using indigo on ubuntu.
Re: how do I look at class variables in debug mode? [message #760476 is a reply to message #760474] Fri, 02 December 2011 14:03 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Use the Expressions view and add the name of the pointer you want to look at.

Marc
Re: how do I look at class variables in debug mode? [message #760481 is a reply to message #760476] Fri, 02 December 2011 14:17 Go to previous messageGo to next message
Arman  is currently offline Arman Friend
Messages: 15
Registered: November 2011
Junior Member
I went to expressions and clicked "add new expression", but I'm not familiar with the way expressions work. I tried to find documentation on this but it was either to broad or for java. Maybe you could get me started by providing a way of looking up the content of a vector pointed to in a class:


struct mystruct {
   vector<float> * vec // I want to know the content of this vector
}


Thanks!
Re: how do I look at class variables in debug mode? [message #760482 is a reply to message #760481] Fri, 02 December 2011 14:22 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
If you declare variable

mystruct myvar;

you would then put in the expressions view:

myvar.vec

However, to see the content of a vector in nice readable format you need to enable pretty-printing:
http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_inspect_the_contents_of_STL_containers.3F

Marc
Previous Topic:How do I see the step before termination in debug mode?
Next Topic:Setting up Eclipse to C++ development using MQ WebSphere
Goto Forum:
  


Current Time: Tue Sep 24 02:22:35 GMT 2024

Powered by FUDForum. Page generated in 0.04759 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top