Debugging runtime libraries

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

Debugging runtime libraries

Post 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?
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Debugging runtime libraries

Post 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 :)
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Debugging runtime libraries

Post 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
Attachments
batchfiles.zip
(1 KiB) Downloaded 22 times
XSharp Development Team
The Netherlands
robert@xsharp.eu
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

Debugging runtime libraries

Post by Serggio »

Thank you, Robert and Chris, for such a detailed answer!
Post Reply