xsharp.eu • Has anybody managed to debug into XSharp runtime
Page 1 of 1

Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 11:01 am
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.

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 12:26 pm
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

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 12:36 pm
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?

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 1:26 pm
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...

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 1:39 pm
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

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 2:21 pm
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)

Re: Has anybody managed to debug into XSharp runtime

Posted: Fri Jan 26, 2024 2:26 pm
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