<p>I have an iterator to a map element, and I would like gdb to show me the values of the "first" and "second" elements of that iterator.
For example:</p>

<pre><code>std::map&lt;int,double&gt; aMap;
...fill map...
std::map&lt;int,double&gt;::const_iterator p = aMap.begin();
</code></pre>

<p>I can use p.first and p.second in the code, but can't see them in gdb. For what it's worth, in dbx one could do something like "print p.node.second_", but I can find anything similar in gbd.</p>

<p>I am totally willing to have a function into which I pass the object types, but I've been unable to get that to work either.</p>

<p>Any ideas? 
Thanks!</p>

Here is how i do it:
```
```
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) list
1       #include <iostream>
2       #include <map>
3
4       int main()
5       {
6           std::map<int, int> a;
7           a[10] = 9;
8           std::map<int, int>::iterator it = a.begin();
9           ++it;
10      }
(gdb) b test.cpp:9
Breakpoint 1 at 0x8048942: file test.cpp, line 9.
(gdb) r
Starting program: /home/js/cpp/a.out

Breakpoint 1, main () at test.cpp:9
9           ++it;
(gdb) set print pretty on
(gdb) p it
$1 = {
  _M_node = 0x94fa008
}
(gdb) p *it
$2 = (class std::pair<const int, int> &) @0x94fa018: {
  first = 10,
  second = 9
}
(gdb)
```
```