Page 1 of 1
Debugging runtime libraries
Posted: Thu May 21, 2020 8:50 am
by Serggio
What is the correct (and simpliest
) way to debug the X# Runtime libraries? There are debug-versions of DLLs in XSharpDebug folder, but how do I use them instead of release builds, so that Visual Studio debugger could see those pdb-files?
Debugging runtime libraries
Posted: Thu May 21, 2020 9:22 am
by Chris
Hi Serggio,
The _simplest_ way, is to just copy those files (together with the .pdb ones) from the debug folder to their respective folders in the GAC, at C:WindowsMicrosoft.NETassemblyGAC_MSIL.XSharp.*, replacing the old ones.
Robert may also tell you the "official" way
Debugging runtime libraries
Posted: Thu May 21, 2020 9:34 am
by robert
Chris, Sergio,
To add debugging for assemblies in the GAC you point VS to the location for the PDBs:
- Debug Options - Symbols (in the tree) - Click [+] and add the location c:Program Files (x86)XSharpRedist
- Debug Options -General - Untick the checkbox "Require Source files to exactly match etc."
- Download the runtime source from Github:
https://github.com/X-Sharp/XSharpPublic/tree/v2410 (this is the tag that matches release 2.4a)
- Copy that source to C:XsharpDevRt
This gives you limited debugging, since the compiler has optimized the code. For full debugging you need to use the DLLs and PDB files from c:Program Files (x86)XSharpDebug and remove the DLLs from the GAC.
I have attached 2 batch files that I use to add / remove the DLLs from the GAC. Run these as administrator
If you remove the files from the GAC then make sure you copy all needed DLLs (including the RDD and Macrocompiler) to your programs output folder with their PDBs.
I have also added a batch file that I use to copy all the Debug versions of the DLLs (from the output folder inside C:XsharpDevRt) into the GAC.
Robert
Debugging runtime libraries
Posted: Thu May 21, 2020 10:51 am
by Serggio
Thank you, Robert and Chris, for such a detailed answer!