adrianstone55 / SymbolSort

A Utility for Measuring C++ Code Bloat
http://gameangst.com/?p=320
Apache License 2.0
117 stars 17 forks source link

Issue when running on Windows #28

Open andrew-donnell opened 5 years ago

andrew-donnell commented 5 years ago

The command SymbolSort.exe -in SymbolSort.exe works fine (even though the results are all zeros), but when I try to command to run on my real target, I get the following issue. Maybe the developer has insight on what might be causing this?

[edit]: I've tried building multiple different ways (with the default VS solution, with a brand new C# project, etc.) per the other Issues on this repo. Everything seems to lead to this same NotImplementedException. I have no issues with building, and my dll file is in the right place and included properly per the instructions I could find here and other places. Clearly I'm still not doing something right though.....

Reading section info...

Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.
   at Dia2Lib.IDiaSession.getEnumTables(IDiaEnumTables& ppEnumTables)
   at SymbolSort.SymbolSort.GetEnumSectionContribs(IDiaSession session) in C:\SymbolSort\SymbolSort.cs:line 679
   at SymbolSort.SymbolSort.BuildSectionContribTable(IDiaSession session, List`1 sectionContribs) in C:\SymbolSort\SymbolSort.cs:line 889
   at SymbolSort.SymbolSort.ReadSymbolsFromPDB(List`1 symbolsOutput, String filename, String searchPath, UserFlags options) in C:\SymbolSort\SymbolSort.cs:line 1198
   at SymbolSort.SymbolSort.LoadSymbols(InputFile inputFile, List`1 symbols, String searchPath, UserFlags options) in C:\SymbolSort\SymbolSort.cs:line 1550
   at SymbolSort.SymbolSort.Main(String[] args) in C:\SymbolSort\SymbolSort.cs:line 1825
StephenE commented 5 years ago

I was able to get further by using the VS2017 version of msdia.dll (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\DIA SDK\bin\amd64). It now falls over here:

[Managed to Native Transition]  
SymbolSort.exe!SymbolSort.SymbolSort.ReadSymbolsFromScope(Dia2Lib.IDiaSymbol parent, Dia2Lib.SymTagEnum type, SymbolSort.SymbolFlags additionalFlags, uint startPercent, uint endPercent, Dia2Lib.IDiaSession diaSession, System.Collections.Generic.List<Dia2Lib.IDiaSectionContrib> sectionContribs, System.Collections.Generic.Dictionary<uint, string> compilandFileMap, System.Collections.Generic.List<SymbolSort.Symbol> symbols) Line 915   C#
SymbolSort.exe!SymbolSort.SymbolSort.ReadSymbolsFromPDB(System.Collections.Generic.List<SymbolSort.Symbol> symbolsOutput, string filename, string searchPath, SymbolSort.UserFlags options) Line 1224   C#
SymbolSort.exe!SymbolSort.SymbolSort.LoadSymbols(SymbolSort.InputFile inputFile, System.Collections.Generic.List<SymbolSort.Symbol> symbols, string searchPath, SymbolSort.UserFlags options) Line 1550 C#
SymbolSort.exe!SymbolSort.SymbolSort.Main(string[] args) Line 1825  C#