views:

623

answers:

3

I am looking for a Linux IDE with support for STL debugging.

the problem is that with Eclipse CDT, if I inspect the vector after the push_back:

int main() {
 vector<string> v;
 v.push_back("blah");
 return 0;
}

I get something hostile like

{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x1fee040, _M_finish = 0x1fee048, _M_end_of_storage = 0x1fee048}}, <No data fields>}

instead of something like

vector["blah"]

or something similar. is there an alternative IDE/Debugger for linux that provides better STL support?

+4  A: 

QtCreator has debugger dumpers for the Qt containers, some of the STL containers and a bunch of the Qt classes. It's also more responsive than Eclipse.

See Qt Creator debugger dumpers.

rpg
interesting, downloading to check it out.
Omry
using QTC 1.2.1 with the above code (without any QT components), I still get the classical crappy vector display.
Omry
It's possible that the dumpers are not built. Go to Tools > Options > Qt > Qt Versions and select your Qt version. See if the debugging helper is marked as build (green checkmark) and if not try to rebuild it. If everything is ok, when running GDB you will get a message "X debugger helpers loaded" on the debugger info bar.
rpg
the debugging helper were indeed not built, I built it successfully but I still don't get it to work. you mean that when I run GDB from the command line I am supposed to get that "X debugger helpers loaded" message?
Omry
Sorry: after you press F5 to start debugging and the debugger stops at a breakpoint (or you do an interrupt), the debugger view will have a gray status bar with start/stop/etc buttons. This bar should display "X custom dumpers found" if it was able to load the debugging helpers. Make sure you have them turned on from Tools > Options > Debugging helpers and that you're running a debug build.
rpg
Alternative way to check: right click the locals and watches debug tab while stopper at breakpoint and click "recheck debugging helper...". The debugger tab should list what helpers it found: eg: \"tdumpers=[\\\"QAbstractItem\\\",\\\"QAbstractItemModel\\\",\\\"QByteArray\\\", etc.
rpg
looks like this only works for QT GUI applications (my original test was a basic QT4 console app). this is a bit too tied up for my liking but I accept it as an answer because it's the closest one to what I am after.
Omry
A: 

This has got nothing to do with the IDE per se, but this is a drawback of the debugger you are using. IDEs, especially on Linux, are just front-ends for debuggers. I suppose you are using GDB, and it won't get any better than this. BTW, while developing on Linux, I use carefully placed print statements instead of a debugger and most of the time I find it better than using a debugger!

Vijay Mathew
A: 

Eclipse use gdb and you can script gdb so it print different types the way you want. I use my own scripts for my own types but there is many available scripts for the stl.

Now the tricky part will be to make this work smoothly is Eclipse, but it can be a solution.

Ben
I am aware of some scripts that improves gdb support for stl, but I am after a full solution.as you said - those scripts does not integrate well with any IDE.
Omry