[gvd-users] (no subject)

Isak Johnsson gvd-users@lists.act-europe.fr
Thu, 22 May 2003 15:44:30 +0200


Hello!

I'm new here. Short personal intro: My name is Isak Johnsson, 25 years 
old, living in Sweden, programmer, running a software development 
company. Been programming C++ for six years, lately with templates. I 
do also enjoy Ruby very much.

GVD is great. Thank you for making it!

I'm often thinking about this when debugging and I'd love to hear your 
thoughts about it!

C++ is crippled by the fact that it's data structures (STL containers) 
are too hard to inspect. As an example, printing a vector consisting of 
a few integers in GDB (and thus GVD) gives:

$1 = {<_Vector_base<int,std::allocator<int> >> = 
{<_Vector_alloc_base<int,std::allocator<int>,true>> = {_M_start = 
0x804a850, _M_finish = 0x804a864, _M_end_of_storage = 0x804a870}, <No 
data fields>}, <No data fields>}

Catastrophic! I want to see the contents.

"print ii._M_start[0]" gives me the first integer, not much better. And 
what about map, sets, multimaps, map to lists, map to maps to lists of 
sets and other data structures you sometimes can find use for, are they 
totally opaque in practice? Or have I missed something important?

Would this be possible to remedy with GVD? I'm thinking about writing 
plug-ins for showing the contents of certain kinds of data structures.

Wouldn't it be possible to write plug-ins in C++ for the data 
structures you are using and compile them with a compiler that has the 
same ABI and the same version of STL so that GVD can pass them a 
pointer to the data structure in question and they can give the 
contents to show back to GVD?

GDB may be the best place to implement this. If so, how would the 
plug-ins interact with GVD?

Looking forward to hear from you!

Kind regards,

Isak