-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method with a function pointer local breaks variables view and debug console #4052
Comments
I have a fix. Should go in shortly. |
Fixed by #4091 |
I am not sure if this is two separate issues I am contending with but... All combinations were tried with NET6 and NET7 using omnisharp 1.25 and 1.25.1 (beta - to see if the issue was resolved). Latest VSCode, etc.. Apologies for the super sloppy code, but I tend to do that when I am fiddling. Just create a quick project, slap code in it, test, then delete it. Anyhow, I have a scenario where I have a collection and a GetEnumerator method. Inside the GetEnumerator method, I call into a Native DLL. The code uses the most basic pinvoke just to eliminate that as a factor. Additionally, I started with the standard pinvoke using dllimport and evolved to trying other stuff like what the code currently shows. It all produces the same issue. The debugger view can not expand the result view of a collection that has a native call in its GetEnumerator method. Interestingly, I kept trying different combinations of code & pinvoke to see if I could get the debugger results view to expand with the internal native call. If I use the marshall class to convert the IntPtr from the function symbol to a delegate and then call the managed delegate within the GetEnumerator, that seems to work fine. The second issue is more apparent directly in the code I have zipped. If there is a C#9 function pointer as a field of a class (in this case), the debugger refuses to elaborate anything within the class in the view. It gives the error shown. One other thing to note is that I tried this within VS community 2022. It appears that the VS community debugger can somewhat handle the GetEnumerator issue, but still fails due to the function pointer. It won't let me expand the list variable, but let's me open another view where you can view the IEnumerable. VS community is fully updated. I zipped the project so that simple things can be fiddled with to see if there are any changes. Is #4091 available yet to test or is it already in 1.25.1 beta? Perhaps it may fix the second issue. |
@LostTime76 please open a new issue instead of commenting on a closed issue. |
Ok. Should I open 2 issues or just one? I am pretty sure these are two separate things. However, I am not sure if the fields one may already be fixed in a pending release and I don't want to open a ticket if I just have to wait for that one. |
I would probably open two issues, but either way is fine. |
Issue Description
When the debugger is stopped in a method that contains a local typed as a function pointer, all state related debug LSP requests seem to break.
Steps to Reproduce
dotnet new console
and paste the code below)Program.cs:L10
Program.cs
MethodPointerDebugRepro.csproj
Expected Behavior
Variables view shows locals and does not display an error. Debug console works.
Actual Behavior
Variables view shows error
Error processing 'variables' request. Unknown Error: 0x80135100
. Evaluating anything in the debug repl returnsInternal error in the C# compiler
.Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.48.2
C# Extension: 1.23.2
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100-rc.2.20459.10 Commit: 2815f3cae1Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.2.20459.10\
Host (useful for support):
Version: 5.0.0-rc.2.20458.14
Commit: 482494f9ec
.NET SDKs installed:
1.0.4 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.102 [C:\Program Files\dotnet\sdk]
3.1.300 [C:\Program Files\dotnet\sdk]
5.0.100-rc.2.20459.10 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-rc.2.20458.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-alpha.1.19564.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-rc.2.20458.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-rc.2.20454.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: