Posted 2024-05-21Updated 2024-06-24gdba few seconds read (About 72 words)gdb-cppgdb 调试 cpp 数据结构的特殊情形 std::string std::vector 对于数据结构更好的调试信息 info pretty-printer std::string1234# 查看元素值## gcc(gdb) p (char *)str(gdb) p str._M_dataplus._M_p[2] std::vector123# 查看元素值## gcc(gdb) p vec._M_impl._M_start[0] gdb-cpphttps://love1angel.github.io/2024/05/21/gdb/gdb-cpp/AuthorHelianthusPosted on2024-05-21Updated on2024-06-24Licensed under