| Problem debugging vector of pointers to objects [message #1231421]
||Tue, 14 January 2014 16:37
| Tim Anderson
Registered: April 2011
Eclipse Juno Build Id: 20120614-1722|
Red Hat Enterprise Linux Workstation 6.3 (Santiago) Kernel Linux 2.6.32-279.14.1.el6.x86_64
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)
I developing an application that is calculating windows of data (as opposed to a GUI Windows) into a stream of data and processing each window individually. So, I've created a Window class that contains all the pertinent information about what each Window will contain. I had some data that needed to be shared between and tried using static variables, but that wasn't happening because one of things was a vector<vector<float> > that I couldn't figure out how to initialize because the sizes of the vectors was determined at runtime.
So, I created a new Windows class that will collect the necessary data from the Window objects. To do this, I created a vector<Window*> that is created in the Windows constructor. I then run through a loop to initialize each element with a new Window.
When I'm debugging my code and try to view the contents of my Window objects I'm not able to. I can look at my Windows object and expand the vector<Window*>, I can see the pointers as elements in the vector, but when I try to expand one of the Window pointers, a blank line appears below the element and is never completely expanded to show the fields in the class.
Looking at the gdb traces console in the Console view, I see the error message:
376,132 105-var-list-children var13..public
376,132 106-var-list-childred var13..private
376,105 105^error,msg="Returned value is not iterable"
Steps I've tried:
- I've tried changing the name of the Window class to see if somehow, somewhere deep in Eclipse or g++ there was a Window class that was messing things up, but that didn't help any.
- I've also tried taking all of the fields from the initialization portion of the Window constructor and put them in the body of the constructor.
- Changed Windows so that it called the default constructor for Window instead of the constructor that passed in the common values, then used setter functions to set them.
- I've tried looking at the contents of vector<Window*> with the command-line gdb and DDD and they display the contents fine.
I don't know if this is a problem with Eclipse because I am able to see the values in gdb and DDD.
I've been fighting this for a couple of weeks, so any help is greatly appreciated.
Powered by FUDForum
. Page generated in 0.01612 seconds