Validating Standard Library Attached Data

I am using ddd 3.3.11 and gdb 6.5-8.fc6rh under it. My compiler is g ++ 4.1.1.

I have a stl map container containing an int (vector) vector as a key search. Key data is in MyType* .

I am using a .gdbinit file written by Dan Marinescu. It works fine until you nest your containers in the C ++ standard library.

My question is that using the validation methods discussed in the .gdbinit file, is there a way to check the stdlib nested data?

The main problem I encountered is when the .gdbinit file tries to make a conclusion.

If my card is of type

  map<vector<int>, MyType*> 

Then, in gdb, I try to call pmap, for example

 pmap myMap vector<int> MyType* 

This does not work with

 elem[0].left: No symbol "vector<int>" in current context. 

What syntax should I use in gdb to cast some data to a template type?

+4
source share
1 answer

Using the later gdb, I had to add single quotes as well as add namespaces and a allocator.

 (gdb) pmap myMap 'std::vector<int,std::allocator<int>>' MyType* elem[0].left: $3 = std::vector of length 1, capacity 1 = {2} elem[0].right: $4 = (MyType *) 0x7fffffffe060 Map size = 1 
+4
source

All Articles