Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: rickg22 on January 10, 2006, 10:45:22 pm
-
Is there a way to find out all the values for a certain STL map? I could watch map[1],map[2] etc, but the [] operator adds the index if it's not found already. So, how to display the contents for an STL map (or vector, whatever) without calling the operators? :?
Also, if there IS a way, how about adding this functionality to the plugin? :mrgreen:
-
Oh, look at what I found! :D
http://staff.science.uva.nl/~gilad/stl/stl_gdb.html
gdb_stl_utils is a small utility that may help solving these problems.
To use it, download and compile StlStdContainers.cc (a simple g++ StlStdContainers.cc -o StlStdContainers.o will do); then, load gdb_stl_utils into gdb by using the command "source gdb_stl_utils" (in gdb). You will then have access to the following gdb function:
p_stl_vector, p_stl_vector_size
p_stl_list, p_stl_list_size
p_stl_tree, p_stl_tree_size (for maps and sets)
p_stl_hash, p_stl_hash_size (for hash_maps and sets)
The names are self-explanatory: the functions print the contents and the sizes of STL containers given to them.
And it's GPL'ed! :D
-
Sounds like it should be added to the GDB debugger plugin. Watching complex memory structures in GDB is a hard thing to do.
-
Altrough I haven't tested myself, I think we should add easy support for STLFilt (http://www.bdsoft.com/tools/stlfilt.html) too. A good thing is that it supports every compiler C::B supports.
STL errors are really cryptic.
-
You don't really need any support of STLFilt, you can just point the compiler executable to it and voila! I've been using it on my linux box at work for quite a while now and I only had to slightly modify the STLFilt configuration.
-
Well, that's why I said more integration, perhaps a plugin.
And with each compiler is different to setup.
That's why a plugin for C::B would come in handy.
-
Does anyone know how well STLFlit works with GCC 4.0? They don't have official support on the website yet.