将以下内容保存成 .gdbinit 文件放到你的根目录,或者在gdb中source这个文件可以加载. 直接print容器即可. # # STL GDB evaluators/views/utilities - 1.03 # # The new GDB commands: # are entirely non instrumental # do not depend on any "inline"(s) - e.g. size(), [], etc # are extremely tol…
GDB中print方法并不能直接打印STL容器中保存的变量,想知道STL容器保存的变量,使用如下办法: 1. 创建文件~/.gdbinit: # # STL GDB evaluators/views/utilities - 1.03 # # The new GDB commands: # are entirely non instrumental # do not depend on any "inline"(s) - e.g. size(), [], etc # are extrem…
GNU gdb (Ubuntu -0ubuntu1~ Copyright (C) Free Software Foundation, Inc. License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the exten…