Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a crash dump which I'm trying to analyze (VC++ 2010).

I then have a callstack that looks like this (I've trimmed a lot here for readability):

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() )

Note the difference in the template parameter of the value (StructA vs. StructB). Now, I know different methods which have exactly the same binary can have the same symbol in the PDB even though they actually use different code. I assume this is the case here (std::map::_Erase is the same no matter the value type).

But how can I know? Is there a list of stl methods (for this MS implementation) for which this applies? Is it possible it's some sort of a bug?

Update:

Looking into the PDB (in a text editor), I see many std::map<...>::_Erase, and specifically I see them for both StructA and StructB. I don't know if it means anything about the folding.

In addition, the disassembled code of std::map shows a call to an address which is interpreted as std::map. I guess this mean code folding...

like image 466
Asaf Avatar asked Nov 13 '22 05:11

Asaf


1 Answers

You can use /OPT:NOICF to disable the code folding behavior.

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

like image 146
StilesCrisis Avatar answered Nov 15 '22 05:11

StilesCrisis