User forums > Using Code::Blocks
see content of a vector in debugging
oBFusCATed:
Do you care for the vector<vector<T> > and vector<string> cases, at the moment?
Or you want to add the simple version and later improve the parsing?
What about large vectors? vectors with -> 1 000, 10 000, 100 000 or 1000 000 items?
Do we limit the watch to the first 10,20,100?
Or there is special syntax for the watches, as in Visual C++ ( "my_var,10" will show the first 10 items)?
Also what about other classes: list, deque, map, set, unordered_map, unordered_set and the multi versions (I've never used :lol:) ?
And the various iterators?
p.s. what will happen if I have /usr/share/codeblocks/scripts/gdb_type.script and ~/.codeblocks/share/codeblocks/scripts/gdb_types.script simultaneously, which of the two will be used?
killerbot:
we care for the others too ;-)
But I think it is best to start with 1 at a time. Try that, when OK, commit.
Then the next one, and so one, in case something might be bad, we only have to take out the bad one, and the others, the working ones, are still present.
About which script will be use, dunno, no script expert :-(
oBFusCATed:
OK, so we want to have vector<int>, vector<some_struct> and so on working on the basic level.
That is doable, I'll take a look at the item count problem tonight and clean the file, so it is ready for commit.
Can I ask some of you to sync the wxaui branch to trunk, because this way it will be easier for me (I'm using in the wxaui branch for everything)?
MortenMacFly:
--- Quote from: oBFusCATed on June 11, 2009, 02:30:07 pm ---Do you care for the vector<vector<T> > and vector<string> cases, at the moment?
--- End quote ---
These are the ones I personally use most. ;-)
--- Quote from: oBFusCATed on June 11, 2009, 02:30:07 pm ---What about large vectors? vectors with -> 1 000, 10 000, 100 000 or 1000 000 items?
Do we limit the watch to the first 10,20,100?
--- End quote ---
I'd vote for that.
--- Quote from: oBFusCATed on June 11, 2009, 02:30:07 pm ---Also what about other classes: list, deque, map, set, unordered_map, unordered_set and the multi versions (I've never used :lol:) ?
And the various iterators?
--- End quote ---
Same thing... but enhancements can come with time...
oBFusCATed:
OK, Here is the cleaned up version. (see the attachment)
But there is one very serious performance problem:
I've modified the main.cpp file and now the v vector has 1000 elements.
This means that the string returned from the pvector command is massive (10-20k characters).
And when I put the v variable in the watches pressing f7 causes 1-5 second of delay (the debugger toolbar is inactive for that period).
Putting return _T("") at the first line of Parse_StlVector doesn't help.
Executing "pvector v 0 20" instead of "pvector v" speeds things up, but doesn't work for vectors with less than 20 elements :(
p.s. If you are using trunk version of C::B replace tostring with the wxString_ToLong
p.s.s. I'm running a q6600 @ 3.4ghz, so on slower machines the problem will be bigger :(
p.s.s.s. I'll run C::B in the debugger to see what is happening, but any hints where to look at will be very welcome
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version