Closed isbobbydigitalak closed 1 year ago
Thanks for reporting this, we'll take a look. We also plan to make new release this week, when it's available please check whether problem reproduces or not.
Will do! Looking forward to it.
@isbobbydigitalak New release is a bit delayed, please try to build netcoredbg with this patch in the mean time:
diff --git a/src/protocols/sourcestorage.cpp b/src/protocols/sourcestorage.cpp
index 2342fdbb..631e43a2 100644
--- a/src/protocols/sourcestorage.cpp
+++ b/src/protocols/sourcestorage.cpp
@@ -63,9 +63,15 @@ namespace netcoredbg
for(char* bufptr = sf->text; bufptr < sf->text + fileLen; )
{
sf->lines.push_back(bufptr);
- while(*bufptr != '\r')
+ while(*bufptr != '\r' && *bufptr != '\n' && *bufptr != '\0')
bufptr++;
- *bufptr++ = '\0';
+ if (*bufptr == '\0')
+ {
+ bufptr++;
+ continue;
+ }
+ if (*bufptr == '\r')
+ *bufptr++ = '\0';
if (*bufptr == '\n')
*bufptr++ = '\0';
}
This might be fixed in latest release, please take a look
Hey!
I was on vacation so sorry about the late response. Just gave it a test run and it seems to be showing the source finally, amazing!
Thank you so much!
I reported that the list command does not work when running in cli interface on simple small (single class, just a few lines in main) projects in #112. That appears to have been fixed in the latest release.
However when I attempt to use it on the project we have at work I still have not been able to get it to work the way it should or be useful even a single time unfortunately.
A small demonstration:
Running
l 1
throughl 6
prints the same entire source file in the same way, with1
inserted at the start of the code, with no location indicator shown. However if I runl 7
I get no output. Same if I runl N
where N >= 7 for a few sampled random numbers. Doing the range thing of listing source from line 5,15 likel 5,15
gives no output. Runningl 1,N
where N >= 1 prints the same as above. Also starting with 0 gives output. However if i runl 2,N
I get no output at all. Stepping forward a few steps withn
doesn't change the situation. If I set the breakpoint in another file, for example the Startup file in ConfigureServices, I get the same behavior, just that it will print the entireStartup.cs
instead ofProgram.cs
. Again prefixed by three spaces, a digit '1', and a tab character.Bad news
I haven't (yet) figured out how to reliably reproduce this, I haven't been able to see this on any other test project than the project at my job, and I can't just provide you with that one. I plan to try to do some divide and conquer stuff, or at least copy the .csproj file and make a test project that has the exact same dependencies to see if that works when I have time. But I thought for now I should at least report it with what I have got so far. Hopefully the strange behavior of printing all of the source with
1
at the beginning offers some hint at least.One thing I did try was to set the Sdk in the test project csproj to be the same
<Project Sdk="Microsoft.NET.Sdk.Web">
as this job project but that didn't seem to make a difference (which is to say, the debugger works on the small test project).Maybe something else I could eventually try is to run netcoredbg in gdb or something to see what is up. Maybe a version built from source would work too, that is something I have not tried yet. A strange thing though is that I can debug this project with the visual studio code debugger which is just using netcoredbg anyway, but with a different protocol for communicating with the editor. So maybe the issue is located specifically in the cli mode?
Thanks!