Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem debugging vector of pointers to objects(Can't expand created objects)
icon8.gif  Problem debugging vector of pointers to objects [message #1231421] Tue, 14 January 2014 16:37 Go to next message
Tim Anderson is currently offline Tim AndersonFriend
Messages: 19
Registered: April 2011
Junior Member
Eclipse Juno Build Id: 20120614-1722
CDT: 8.1.0.20120611
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:
Quote:

376,132 105-var-list-children var13.[0].public
376,132 106-var-list-childred var13.[0].private
376,105 105^error,msg="Returned value is not iterable"


Steps I've tried:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
Re: Problem debugging vector of pointers to objects [message #1231781 is a reply to message #1231421] Wed, 15 January 2014 11:39 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
There could be a problem with your python pretty-printers, or it could be a bug in GDB.
I would recommend upgrading your tools, especially GDB to see if it fixes the problem.

Marc
Previous Topic:How to set GDB breakpoint actions?
Next Topic:Eclipse CDT Indexer Does not work
Goto Forum:
  


Current Time: Thu Apr 25 19:45:42 GMT 2024

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

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

Back to the top