在gdb下查看map,vector,queue的数据

来源:互联网 发布:mac虚拟机配置文件 编辑:程序博客网 时间:2024/06/06 00:16
从这里下载一个gdb脚本:http://sourceware.org/gdb/wiki/STLSupport

 启动gdb之后,用 source stl-views.gdb 把这个脚本包含进来,

 然后就可以用 pmap 命令打印 map 的内容了。



Data typeGDB commandstd::vector<T>pvector stl_variablestd::list<T>plist stl_variable Tstd::map<T,T>pmap stl_variablestd::multimap<T,T>pmap stl_variablestd::set<T>pset stl_variable Tstd::multiset<T>pset stl_variablestd::deque<T>pdequeue stl_variablestd::stack<T>pstack stl_variablestd::queue<T>pqueue stl_variablestd::priority_queue<T>ppqueue stl_variablestd::bitset<n>td>pbitset stl_variablestd::stringpstring stl_variablestd::widestringpwstring stl_variable

0 0