对于VS2015,我不得不修改autoexp.dat的列表,例如:
std::list<*>{
preview (
#(
"[",
$e._Mypair._Myval2._Mysize,
"](",
#list(
head: $e._Mypair._Myval2._Myhead->_Next,
size: $e._Mypair._Myval2._Mysize,
next: _Next
) : $e._Myval,
")"
)
)
children (
#list(
head: $e._Mypair._Myval2._Myhead->_Next,
size: $e._Mypair._Myval2._Mysize,
next: _Next
) : $e._Myval
)
}
这些变化从检查VS2015 stl.natvis,并指出了各种数据结构上作出标记<!-- VC 2015 -->
的变化来
我做出决定的其他STL结构适当的变化,以及,虽然被警告我没有测试过所有
std::unique_ptr<*>{
preview (
#if ($e._Mypair._Myval2 == 0) (
"empty"
) #else (
#(
"unique_ptr ",
*$e._Mypair._Myval2
)
)
)
children (
#if ($e._Mypair._Myval2 == 0) (
#array(expr: 0, size: 0)
) #else (
#([ptr] : $e._Mypair._Myval2)
)
)
}
std::_Bind<*>{
preview (
#(
"bind(", $e._Mypair,
", ", $e._Mypair._Myval2,
")"
)
)
children (
#(
#([f] : $e._Mypair),
#([bound_args] : $e._Mypair._Myval2)
)
)
}
std::_Mem_fn_wrap<*>{
preview (
; We preview the functor returned by mem_fn() with "mem_fn(<stored member function pointer>)".
#(
"mem_fn(",
$e._Pm,
")"
)
)
children (
; Member function pointers have no children.
#array(expr: 0, size: 0)
)
}
std::_Func_impl<*>{
preview ($e._Mypair._Myval2)
children (
#(
#([functor] : $e._Mypair._Myval2),
#([allocator] : $e._Mypair)
)
)
}
std::function<*>{
preview (
#if ($e._Mystorage._Ptrs[$e._Impl] == 0) (
; Detecting empty functions is trivial.
"empty"
) #else (
*$e._Mystorage._Ptrs[$e._Impl]
)
)
children (
#if ($e._Mystorage._Ptrs[$e._Impl] == 0) (
; We make empty functions appear to have no children.
#array(expr: 0, size: 0)
) #else (
#([functor and allocator] : *$e._Mystorage._ptrs[$e._Impl])
)
)
}
std::basic_string<char,*>{
preview (#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) ([$e._Mypair._Myval2._Bx._Buf,s]) #else ([$e._Mypair._Myval2._Bx._Ptr,s]))
stringview (#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) ([$e._Mypair._Myval2._Bx._Buf,sb]) #else ([$e._Mypair._Myval2._Bx._Ptr,sb]))
children (
#(
#([size] : $e._Mypair._Myval2._Mysize),
#([capacity] : $e._Mypair._Myval2._Myres),
#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) (
#array(expr: $e._Mypair._Myval2._Bx._Buf[$i], size: $e._Mypair._Myval2._Mysize)
) #else (
#array(expr: $e._Mypair._Myval2._Bx._Ptr[$i], size: $e._Mypair._Myval2._Mysize)
)
)
)
}
std::basic_string<unsigned short,*>|std::basic_string<wchar_t,*>{
preview (#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) ([$e._Mypair._Myval2._Bx._Buf,su]) #else ([$e._Mypair._Myval2._Bx._Ptr,su]))
stringview (#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) ([$e._Mypair._Myval2._Bx._Buf,sub]) #else ([$e._Mypair._Myval2._Bx._Ptr,sub]))
children (
#(
#([size] : $e._Mypair._Myval2._Mysize),
#([capacity] : $e._Mypair._Myval2._Myres),
#if (($e._Mypair._Myval2._Myres) < ($e._Mypair._Myval2._BUF_SIZE)) (
#array(expr: $e._Mypair._Myval2._Bx._Buf[$i], size: $e._Mypair._Myval2._Mysize)
) #else (
#array(expr: $e._Mypair._Myval2._Bx._Ptr[$i], size: $e._Mypair._Myval2._Mysize)
)
)
)
}
std::deque<*>{
preview (
#(
"[",
$e._Mypair._Myval2._Mysize,
"](",
#array(
expr: $e._Mypair._Myval2._Map[(($i + $e._Mypair._Myval2._Myoff)/$e._EEN_DS) % $e._Mypair._Myval2._Mapsize][($i + $e._Mypair._Myval2._Myoff) % $e._EEN_DS],
size: $e._Mypair._Myval2._Mysize
),
")"
)
)
children (
#(
#array(
expr: $e._Mypair._Myval2._Map[(($i + $e._Mypair._Myval2._Myoff)/$e._EEN_DS) % $e._Mypair._Myval2._Mapsize][($i + $e._Mypair._Myval2._Myoff) % $e._EEN_DS],
size: $e._Mypair._Myval2._Mysize
)
)
)
}
std::forward_list<*>{
preview (
#(
"(",
#list(
head: $e._Mypair._Myval2._Myhead,
next: _Next
) : $e._Myval,
")"
)
)
children (
#list(
head: $e._Mypair._Myval2._Myhead,
next: _Next
) : $e._Myval
)
}
std::vector<bool,*>{
preview (
#(
"[",
$e._Mysize,
"](",
#array(
expr: (bool)(($e._Myvec._Mypair._Myval2._Myfirst[$i/$e._EEN_VBITS] >> ($i % $e._EEN_VBITS)) & 1),
size: $e._Mysize
),
")"
)
)
children (
#(
#([size] : $e._Mysize),
#([capacity] : ($e._Myvec._Mypair._Myval2._Myend - $e._Myvec._Mypair._Myval2._Myfirst) * $e._EEN_VBITS),
#array(
expr: (bool)(($e._Myvec._Mypair._Myval2._Myfirst[$i/$e._EEN_VBITS] >> ($i % $e._EEN_VBITS)) & 1),
size: $e._Mysize
)
)
)
}
std::vector<*>{
preview (
#(
"[",
$e._Mypair._Myval2._Mylast - $e._Mypair._Myval2._Myfirst,
"](",
#array(
expr: $e._Mypair._Myval2._Myfirst[$i],
size: $e._Mypair._Myval2._Mylast - $e._Mypair._Myval2._Myfirst
),
")"
)
)
children (
#(
#([size] : $e._Mypair._Myval2._Mylast - $e._Mypair._Myval2._Myfirst),
#([capacity] : $e._Mypair._Myval2._Myend - $e._Mypair._Myval2._Myfirst),
#array(
expr: $e._Mypair._Myval2._Myfirst[$i],
size: $e._Mypair._Myval2._Mylast - $e._Mypair._Myval2._Myfirst
)
)
)
}
std::map<*>|std::multimap<*>|std::set<*>|std::multiset<*>{
preview (
#(
"[",
$e._Mypair._Myval2._Myval2._Mysize,
"](",
#tree(
head: $e._Mypair._Myval2._Myval2._Myhead->_Parent,
skip: $e._Mypair._Myval2._Myval2._Myhead,
left: _Left,
right: _Right,
size: $e._Mypair._Myval2._Myval2._Mysize
) : $e._Myval,
")"
)
)
children (
#(
#tree(
head: $e._Mypair._Myval2._Myval2._Myhead->_Parent,
skip: $e._Mypair._Myval2._Myval2._Myhead,
left: _Left,
right: _Right,
size: $e._Mypair._Myval2._Myval2._Mysize
) : $e._Myval
)
)
}
std::unordered_map<*>|std::unordered_multimap<*>|std::unordered_set<*>|std::unordered_multiset<*>|stdext::hash_map<*>|stdext::hash_multimap<*>|stdext::hash_set<*>|stdext::hash_multiset<*>{
preview (
#(
"[",
$e._List._Mysize,
"](",
#list(
head: $e._List._Myhead->_Next,
size: $e._List._Mysize,
next: _Next
) : $e._Myval,
")"
)
)
children (
#list(
head: $e._List._Myhead->_Next,
size: $e._List._Mysize,
next: _Next
) : $e._Myval
)
}
多年来,在调试器中查看C++数据结构的MSFT支持并不总是很好。如果这被忽略了,我不会感到惊讶。 – edtheprogrammerguy
您是编译调试版本还是尝试在发行版中调试? – Melkon
这通常适用于VS2015。如果您正在编译Release版本,则调试器可能无法解析所有变量。我能想到的其他(不太可能)的可能性是一个腐败的[natvis文件](https://msdn.microsoft.com/en-us/library/jj620914.aspx) – mattnewport