1、gdb版本大于7.0
(gdb) p yourvector
2、打印整个vector
(gdb) p *(yourvector._m_impl._m_start)@yourvector.size()
3、打印第n个元素
p *(yourvector._m_impl._m_start)@n
4、代码中实现遍历打印元素,使用gdb call
(gdb) call function(yourvector)
1、gdb版本大于7.0
(gdb) p yourvector
2、打印整个vector
(gdb) p *(yourvector._m_impl._m_start)@yourvector.size()
3、打印第n个元素
p *(yourvector._m_impl._m_start)@n
4、代码中实现遍历打印元素,使用gdb call
(gdb) call function(yourvector)