gdb cannot index into an array and print value
<p>I have an object <code>a</code> of type <code>vector&lt;char&gt;</code>. I know it is 10 elements long. But, when I do <code>p a[5]</code> in gdb, I get an error saying gdb could not resolve symbol <code>operator[]</code>. </p>

<pre><code>void foo()
{
    vector&lt;char&gt; a (10, 10); // put a breakpoint here.
}
</code></pre>

<p>Could you please suggest me a way to print the value at index in gdb? Right now, I did something really lame - </p>

<p><code>char c1=a[1]; char c2 = a[2]; char c3 = a[3]; // ... so on and forth</code></p>

<p>Can I trust the values in <code>c1</code>, <code>c2</code>, etc</p>

<p>P.S. I have built my code with DEBUG symbols.</p>