GDB调试笔记
查看string size
print ((size_t*)string_name._M_dataplus)[-3]
打印vector内容
1)打印整个vector(myVector 为vector 名称) (gdb) p *(myVector._M_impl._M_start)@myVector.size() 2)打印第N个成员 (gdb) p *(myVector._M_impl._M_start)@N
GDB调试笔记
print ((size_t*)string_name._M_dataplus)[-3]
1)打印整个vector(myVector 为vector 名称) (gdb) p *(myVector._M_impl._M_start)@myVector.size() 2)打印第N个成员 (gdb) p *(myVector._M_impl._M_start)@N