Skip to content
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

[BUG] Exception when creating breakpoints with NVIM and the Unity debugger #1705

Open
Erifirin opened this issue Dec 25, 2024 · 1 comment
Open
Assignees
Labels
area-unity Unity support bug Something isn't working fixed-pending-release
Milestone

Comments

@Erifirin
Copy link

Erifirin commented Dec 25, 2024

Describe the Issue

In short, Unity debug adapter does not comply with DAP specification.

I use nvim to work with Unity projects and visualstudiotoolsforunity.vstuc as DAP. It works fine at first. Debug adapter attaches to Unity without any errors. However, if I set a breakpoint somewhere, my debug session crashes with NullReferenceException:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.Unity.ExceptionManager.ProcessRequest(SetExceptionBreakpointsArguments arguments)
   at Microsoft.VisualStudio.Unity.AD7DebugAdapter.HandleSetExceptionBreakpointsRequest(SetExceptionBreakpointsArguments arguments)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.DebugAdapterBase.HandleProtocolRequest(String requestType, Object requestArgs)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.DebugAdapterBase.OnProtocolRequestReceived(Object sender, RequestReceivedEventArgs e)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.OnRequestReceived(String command, IRequestResponder responder)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.DebugAdapterBase.HandleSetExceptionBreakpointsRequestAsync(IRequestResponder`1 responder)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.DebugAdapterBase.HandleSetExceptionBreakpointsRequestAsync(IRequestResponder`2 responder)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.DebugAdapterBase.<InitializeProtocolClient>b__5_37(IRequestResponder`2 r)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.RequestWithResponseInfo`2.InvokeHandler(DebugProtocol protocol, ProtocolRequest request, Object args)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.HandleIncomingRequest(String msg)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.HandleIncomingMessage(String msg)
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.ProcessMessageBody()
   at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.ReaderThreadProc()

As it turns out, the exception occurs due to the lack of filterOptions in SetExceptionBreakpointsRequest. But according to the specification, filterOptions are considered optional (https://microsoft.github.io/debug-adapter-protocol/specification.html#Requests_SetExceptionBreakpoints).

Looks like an issue.

Environment Information

nvim 0.10.2
visualstudiotoolsforunity.vstuc 1.0.5
Unity 2022.3.54 + Visual Studio Editor package 2.0.22

vstuc log: vstuc.log
nvim dap config: unity.lua

@Erifirin Erifirin added the bug Something isn't working label Dec 25, 2024
@phil-allen-msft phil-allen-msft added the area-unity Unity support label Jan 3, 2025
@jbevain jbevain self-assigned this Jan 6, 2025
@jbevain jbevain changed the title [BUG] breakpoints in visualstudiotoolsforunity.vstuc are broken [BUG] Exception when creating breakpoints with NVIM and the Unity debugger Jan 6, 2025
@jbevain jbevain added this to the Backlog milestone Jan 6, 2025
@jbevain
Copy link
Member

jbevain commented Jan 6, 2025

Thanks for the report! This exception should be fixed in the next release of the Unity extension for Visual Studio Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-unity Unity support bug Something isn't working fixed-pending-release
Projects
None yet
Development

No branches or pull requests

3 participants