Has anybody managed to debug into XSharp runtime

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
baramuse
Posts: 98
Joined: Tue Nov 29, 2022 8:31 am
Location: France

Has anybody managed to debug into XSharp runtime

Post by baramuse »

Hi all

I was wondering if anybody managed to debug into .prg files of XS runtime (as the source is public) instead of visual studio debugging in the generated .cs source.
Our project is pretty big and sometimes I need to understand the source of our bugs.
I'm pretty sure at some point I managed to, as VS was asking me the source files (.prg) of XS.

I tried to import the XS.RT project in mine for example, it builds, but even if it's referenced by my project, it does not seems to pick it up (missing reference).

Anyway if anyone has experience with that and would like to share !

Best regards.
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Has anybody managed to debug into XSharp runtime

Post by wriedmann »

Hello,
I have done that sometimes in the past, but it required some work.
I have downloaded the source and changed the version numbers. Then I have compiled the entire project and used the resulting assemblies as dependencies in my test application.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
baramuse
Posts: 98
Joined: Tue Nov 29, 2022 8:31 am
Location: France

Re: Has anybody managed to debug into XSharp runtime

Post by baramuse »

wriedmann wrote: Fri Jan 26, 2024 12:26 pm Hello,
I have done that sometimes in the past, but it required some work.
I have downloaded the source and changed the version numbers. Then I have compiled the entire project and used the resulting assemblies as dependencies in my test application.
Wolfgang
Hi Wolfgang,

I just did that, compiled the runtime from source, referenced those dll in my project, still when I step inside a XS.RT function for example, it either asks me for Function.cs (and not prg) or show me the generated CS code (ugly).

Why did you change the version number?
User avatar
baramuse
Posts: 98
Joined: Tue Nov 29, 2022 8:31 am
Location: France

Re: Has anybody managed to debug into XSharp runtime

Post by baramuse »

I actually have on VM on which stepping into XS code does asks for the PRG source and steps into XS source.
But even with both VM side to side, I can't find the switch that does allow my new VM to step into PRG files and not asks for Functions.cs all the time...
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Has anybody managed to debug into XSharp runtime

Post by wriedmann »

Hi,
I have changed the version number to make sure the .NET runtime takes my own assemblies with the correct source paths and not the ones from the GAC.
In this way I could also change the code in the runtime and check if it worked.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4936
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Has anybody managed to debug into XSharp runtime

Post by Chris »

Guys,

No need to change version numbers, you can simply copy the .pdb file of the assembly you want to debug in the same folder in the GAC where the .dll is.

It is not even necessary to rebuild the runtime, you can simply put in the GAC folder official X# files, the .dll and .pdb of the assembly you want to debug, just need to use the debug version of the assembly, which you can find in the \Debug subfolder of your X# installation folder. Just make sure that you have unzipped the X# rutnime source code in the folder C:\xSharp\DevRt, because that's what we are also using, so the debugger will expect to find the source code there (this information is stored in the .pdb file)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Has anybody managed to debug into XSharp runtime

Post by wriedmann »

Hi Chris,
I have done the change of the version numbers to have my own set of DLLs where I could do some changes for myself without touching the rest of the system (it was when I worked with the XGUI classes). So it is the harder way that the one you described, but for my purpose it was the cleaner approach (and without touching the GAC...)
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply