无论模板参数如何,哪些std::map方法是相同的(并且可能共享符号)

Which std::map methods are identical (and might share symbols) regardless of template parameters?

本文关键字:符号 共享 方法 参数 map std 哪些      更新时间:2023-10-16

我有一个崩溃转储,我试图分析(vc++ 2010)。

然后我有一个调用栈,看起来像这样(为了可读性,我在这里做了很多调整):
myapp.exe!std::_Tree<std::_Tmap_traits<unsigned int,StructB,std::less<unsigned int> ... >::_Erase(...)
myapp.exe!std::_Tree<std::_Tmap_traits<unsigned int,StructA,std::less<unsigned int>,... >::clear() 

(clear() calls _Erase())

注意值的模板形参的区别(StructA和StructB)。现在,我知道具有完全相同二进制的不同方法可以在PDB中具有相同的符号,即使它们实际上使用不同的代码。我假设这里就是这种情况(std::map::_Erase无论值类型如何都是相同的)。

但是我怎么知道呢?是否有一个stl方法列表(对于这个MS实现)适用于此?会不会是某种bug?

更新:

查看PDB(在文本编辑器中),我看到许多std::map<…>::_Erase,我在StructA和StructB中都看到了它们。我不知道这是否意味着折叠。

此外,std::map的反汇编代码显示了对一个地址的调用,该地址被解释为std::map。我猜这意味着代码折叠…

您可以使用/OPT:NOICF禁用代码折叠行为。

http://msdn.microsoft.com/en-us/library/bxwfs976%28v=vs.80%29.aspx

最后,我创建了一个地图文件进行重建。在映射文件中,我可以看到两个方法(_Erase for StructA和_Erase for StructB)都有相同的地址。所以这不是bug