Jump to content

pdb2mdb bit error in Visual Studio 2015


Recommended Posts

I have VS 2015 RTM (released July 20) and also the new Unity tools for Visual Studio 2015 released along with it.

The Unity mono tool pdb2mdb fails with a bit error:

Fatal error : 
1> Microsoft.Cci.Pdb.PdbDebugException: Unknown custom metadata item kind: 6
1> at Microsoft.Cci.Pdb.PdbFunction.ReadCustomMetadata (Microsoft.Cci.Pdb.BitAccess bits) [0x00000] in <filename unknown>:0
1> at Microsoft.Cci.Pdb.PdbFunction..ctor (System.String module, ManProcSym proc, Microsoft.Cci.Pdb.BitAccess bits) [0x00000] in <filename unknown>:0
1> at Microsoft.Cci.Pdb.PdbFunction.LoadManagedFunctions (System.String module, Microsoft.Cci.Pdb.BitAccess bits, UInt32 limit, Boolean readStrings) [0x00000] in <filename unknown>:0
1> at Microsoft.Cci.Pdb.PdbFile.LoadFuncsFromDbiModule (Microsoft.Cci.Pdb.BitAccess bits, Microsoft.Cci.Pdb.DbiModuleInfo info, Microsoft.Cci.Pdb.IntHashTable names, System.Collections.ArrayList funcList, Boolean readStrings, Microsoft.Cci.Pdb.MsfDirectory dir, System.Collections.Generic.Dictionary`2 nameIndex, Microsoft.Cci.Pdb.PdbReader reader) [0x00000] in <filename unknown>:0
1> at Microsoft.Cci.Pdb.PdbFile.LoadFunctions (System.IO.Stream read, Microsoft.Cci.Pdb.BitAccess bits, Boolean readAllStrings) [0x00000] in <filename unknown>:0
1> at Microsoft.Cci.Pdb.PdbFile.LoadFunctions (System.IO.Stream read, Boolean readAllStrings) [0x00000] in <filename unknown>:0
1> at Pdb2Mdb.Driver.Convert (Mono.Cecil.AssemblyDefinition assembly, System.IO.Stream pdb, Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb) [0x00000] in <filename unknown>:0

The rest of it works, the conversion from the pdb output to mdb just fails.

I tried downloading the current version of Mono (4.0.2 release which has the 4.5 release of pdb2mdb) however this runs into another issue in that the release of Unity 4.x doesn't work with that (Cecil library dependency is the wrong version).

Unsure if anyone has run into this and solved it.

The same code works fine with Visual Studio 2013 btw so it's a tool/version issue as far as I can tell. There is a note on the Mono source for pdb2mdb that says there was a problem reading bits dated sometime in May which was fixed, I however conclude that the fix is definitely not in the version of Mono included with Unity 4.6.x - that uses the 4.0 Mono library. Unsure if this has anything to do with the error I'm getting above when running pdb2mdb. I would however think that the 4.5 release of pdb2mdb requires the 4.5 runtime which is fine, however once the mdb file is output, it should work with the 4.0 runtime for the purpose of guiding the debugger. Assumption there of course as I can't get pdb2mdb 4.5 to work at all right now.

Thanks!

Z.

Edited by ziporama
Link to comment
Share on other sites

  • 4 weeks later...
  • 8 months later...

Moving ahead to almost a year later, under Unity 5.2.4f1 (for the KSP 1.1 update), the current release of Mono 4.5 is compatible with VS2015 so the bit error goes away when compiling under VS2015.  

Alas, only to be replaced with the new issue that Unity 5.2.4f1 only goes up to Mono 4.0 and KSP 1.1 requires 5.2.4f1.  

So, when compiling now, pdbtomdb issue is gone, but replaced by a Mono.Cecil version issue (4.x vs 4.5x).

Will this ever end?

I guess we're still using VS2013 4 years later :)

Edited by ziporama
Link to comment
Share on other sites

You may want to read the updated version of the debugging post since I lined a version that works. And no, the mono shipped with the game is still .NET 3.5 only (2.0 CLI)

Edited by sarbian
Link to comment
Share on other sites

@sarbian Thanks!  Your instructions fill such a gap for what is otherwise a near total vacuum of information - this is great.

I see your tools zip file contains Mono.Cecil 0.9.5 whereas the version in Unity 5.2.4f1 is 0.9.4.   I was able to compile just fine with your version of pdb2mdb and cecil 0.9.5 under VS2015.  Unfortunately, pdb2mdb.exe doesn't have a file version (0.0.0.0) so i can't tell the difference outside that it's a different file size so different file from the one shipped in Unity - I assume this is the current release.   Found some more information here: https://gist.github.com/jbevain/ba23149da8369e4a966f

In conclusion, KSP 1.1 plugins written in Visual Studio 2015, and specifically, the pdb (debug) files can only be converted to Unity debug files (mdb) by Mono.Cecil 0.9.5 and above.

 

 

Edited by ziporama
typeo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...