C++ to C# Conversion Local Variable Names Changed to numxxx

DavidFuchsDavidFuchs Posts: 3
edited December 29, 2015 12:04PM in .NET Reflector Previous Versions
First to bring you up to speed. I am converting TA-lib (http://sourceforge.net/projects/ta-lib/) from Managed C++ to C#, none of the language translation programs I have tried has even come close to working, More than likely because the code is setup for use with CMake. I have compiled the class library down to a dll and have used .Net Reflector to translate it to C#.

Issue(s)
1) the local variable names have been replaced with (numXXX... numNNN). I have the original code. Is there any way, with the original code, or a pdb file, to insert the correct variable names in the export.

Doing this by hand would take a while as the main CS file is over 100,000 lines long. :-)

Comments

  • Hi DavidFuchs,

    Symbol names for local variables are not stored in the compiled assemblies, but rather in the associated PDB files. If there are no PDB files (i.e. if it was compiled in release mode)then .NET Reflector will generate names for local variables so that it can display something meaningful in the disassembler view.

    Hope that helps!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Thank you that helps a lot. The variables names are there when de-compiling the debug dll. One further question, the release build of the dll also has a pdb file associated with it every time it is compiled in VS 2010, why do the variables not show up when de-compiling it(the release mode dll)?
  • Hi DavidFuchs!

    I believe the release builds don't have as much detail since they are by default built with the "Optimize code" option. If you disable this option for the release configuration (from Visual Studio under Project>Properties>Build) and rebuild, do you see the local variable names for the release build?

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.