77using System ;
88using System . Collections . Generic ;
99using System . IO ;
10- using System . Threading ;
1110using System . Linq ;
1211using System . Net ;
12+ using System . Threading ;
1313using Microsoft . VisualStudio . Shared . VSCodeDebugProtocol . Messages ;
1414using Mono . Debugging . Client ;
15- using VSCodeDebug ;
15+ using Mono . Debugging . Soft ;
1616using MonoDevelop . Debugger . Soft . Unity ;
1717using MonoDevelop . Unity . Debugger ;
1818using Newtonsoft . Json . Linq ;
19+ using VSCodeDebug ;
1920using Breakpoint = Mono . Debugging . Client . Breakpoint ;
20- using ResponseBreakpoint = Microsoft . VisualStudio . Shared . VSCodeDebugProtocol . Messages . Breakpoint ;
2121using ExceptionBreakpointsFilter = VSCodeDebug . ExceptionBreakpointsFilter ;
2222using InitializedEvent = VSCodeDebug . InitializedEvent ;
2323using OutputEvent = VSCodeDebug . OutputEvent ;
24+ using ResponseBreakpoint = Microsoft . VisualStudio . Shared . VSCodeDebugProtocol . Messages . Breakpoint ;
2425using Scope = VSCodeDebug . Scope ;
2526using Source = VSCodeDebug . Source ;
2627using SourceBreakpoint = VSCodeDebug . SourceBreakpoint ;
2728using StackFrame = Mono . Debugging . Client . StackFrame ;
2829using StoppedEvent = VSCodeDebug . StoppedEvent ;
2930using TerminatedEvent = VSCodeDebug . TerminatedEvent ;
31+ using Thread = VSCodeDebug . Thread ;
3032using ThreadEvent = VSCodeDebug . ThreadEvent ;
3133using UnityProcessInfo = MonoDevelop . Debugger . Soft . Unity . UnityProcessInfo ;
3234using Variable = VSCodeDebug . Variable ;
@@ -46,24 +48,26 @@ internal class UnityDebugSession : DebugSession
4648 private const int MAX_CONNECTION_ATTEMPTS = 10 ;
4749 private const int CONNECTION_ATTEMPT_INTERVAL = 500 ;
4850
49- private AutoResetEvent m_ResumeEvent = new AutoResetEvent ( false ) ;
51+ private AutoResetEvent m_ResumeEvent ;
5052 private bool m_DebuggeeExecuting ;
5153 private readonly object m_Lock = new object ( ) ;
52- private Mono . Debugging . Soft . SoftDebuggerSession m_Session ;
54+ private SoftDebuggerSession m_Session ;
5355 private ProcessInfo m_ActiveProcess ;
54- SourceBreakpoint [ ] m_Breakpoints = new SourceBreakpoint [ 0 ] ;
56+ SourceBreakpoint [ ] m_Breakpoints ;
5557 private List < Catchpoint > m_Catchpoints ;
5658 private DebuggerSessionOptions m_DebuggerSessionOptions ;
5759
5860 private Handles < ObjectValue [ ] > m_VariableHandles ;
5961 private Handles < StackFrame > m_FrameHandles ;
6062 private ObjectValue m_Exception ;
61- private Dictionary < int , VSCodeDebug . Thread > m_SeenThreads ;
63+ private Dictionary < int , Thread > m_SeenThreads ;
6264 private bool m_Terminated ;
6365 IUnityDbgConnector unityDebugConnector ;
6466
6567 public UnityDebugSession ( ) : base ( )
6668 {
69+ m_ResumeEvent = new AutoResetEvent ( false ) ;
70+ m_Breakpoints = new SourceBreakpoint [ 0 ] ;
6771 m_VariableHandles = new Handles < ObjectValue [ ] > ( ) ;
6872 m_FrameHandles = new Handles < Mono . Debugging . Client . StackFrame > ( ) ;
6973 m_SeenThreads = new Dictionary < int , VSCodeDebug . Thread > ( ) ;
@@ -157,7 +161,7 @@ public UnityDebugSession() : base()
157161 m_Session . TargetThreadStarted += ( sender , e ) => {
158162 int tid = ( int ) e . Thread . Id ;
159163 lock ( m_SeenThreads ) {
160- m_SeenThreads [ tid ] = new VSCodeDebug . Thread ( tid , e . Thread . Name ) ;
164+ m_SeenThreads [ tid ] = new Thread ( tid , e . Thread . Name ) ;
161165 }
162166 SendEvent ( new ThreadEvent ( "started" , tid ) ) ;
163167 } ;
@@ -275,12 +279,12 @@ private void Connect(IPAddress address, int port)
275279 {
276280 lock ( m_Lock ) {
277281
278- var args0 = new Mono . Debugging . Soft . SoftDebuggerConnectArgs ( string . Empty , address , port ) {
282+ var args0 = new SoftDebuggerConnectArgs ( string . Empty , address , port ) {
279283 MaxConnectionAttempts = MAX_CONNECTION_ATTEMPTS ,
280284 TimeBetweenConnectionAttempts = CONNECTION_ATTEMPT_INTERVAL
281285 } ;
282286
283- m_Session . Run ( new Mono . Debugging . Soft . SoftDebuggerStartInfo ( args0 ) , m_DebuggerSessionOptions ) ;
287+ m_Session . Run ( new SoftDebuggerStartInfo ( args0 ) , m_DebuggerSessionOptions ) ;
284288
285289 m_DebuggeeExecuting = true ;
286290 }
@@ -361,7 +365,7 @@ public override void SetFunctionBreakpoints(Response response, dynamic arguments
361365 public override void Continue ( Response response , dynamic args )
362366 {
363367 WaitForSuspend ( ) ;
364- SendResponse ( response ) ;
368+ SendResponse ( response , new ContinueResponseBody ( ) ) ;
365369 lock ( m_Lock ) {
366370 if ( m_Session == null || m_Session . IsRunning || m_Session . HasExited ) return ;
367371
@@ -656,16 +660,16 @@ public override void Variables(Response response, dynamic args)
656660
657661 public override void Threads ( Response response , dynamic args )
658662 {
659- var threads = new List < VSCodeDebug . Thread > ( ) ;
663+ var threads = new List < Thread > ( ) ;
660664 var process = m_ActiveProcess ;
661665 if ( process != null ) {
662- Dictionary < int , VSCodeDebug . Thread > d ;
666+ Dictionary < int , Thread > d ;
663667 lock ( m_SeenThreads ) {
664- d = new Dictionary < int , VSCodeDebug . Thread > ( m_SeenThreads ) ;
668+ d = new Dictionary < int , Thread > ( m_SeenThreads ) ;
665669 }
666670 foreach ( var t in process . GetThreads ( ) ) {
667671 int tid = ( int ) t . Id ;
668- d [ tid ] = new VSCodeDebug . Thread ( tid , t . Name ) ;
672+ d [ tid ] = new Thread ( tid , t . Name ) ;
669673 }
670674 threads = d . Values . ToList ( ) ;
671675 }
0 commit comments