1212using System . Net ;
1313using Microsoft . VisualStudio . Shared . VSCodeDebugProtocol . Messages ;
1414using Mono . Debugging . Client ;
15+ using Mono . Debugging . Evaluation ;
16+ using Mono . Debugging . Soft ;
1517using VSCodeDebug ;
1618using MonoDevelop . Debugger . Soft . Unity ;
1719using MonoDevelop . Unity . Debugger ;
@@ -192,7 +194,7 @@ public override void Initialize(Response response, dynamic args)
192194 supportsConfigurationDoneRequest = false ,
193195
194196 // This debug adapter does not support function breakpoints.
195- supportsFunctionBreakpoints = true ,
197+ supportsFunctionBreakpoints = false ,
196198
197199 // This debug adapter doesn't support conditional breakpoints.
198200 supportsConditionalBreakpoints = true ,
@@ -207,11 +209,7 @@ public override void Initialize(Response response, dynamic args)
207209 supportsSetVariable = true ,
208210
209211 // This debug adapter does not support exception breakpoint filters
210- exceptionBreakpointFilters = new [ ]
211- {
212- new ExceptionBreakpointsFilter ( "all_exceptions" , "All Exceptions" ) ,
213- new ExceptionBreakpointsFilter ( "unhandled" , "Unhandled_exceptions" ) ,
214- }
212+ exceptionBreakpointFilters = new ExceptionBreakpointsFilter [ 0 ]
215213 } ) ;
216214
217215 // Mono Debug is ready to accept breakpoints immediately
@@ -435,8 +433,6 @@ private void PauseDebugger()
435433
436434 protected override void SetVariable ( Response response , object args )
437435 {
438- SendOutput ( "stdout" , "Found this: " + args ) ;
439- SendOutput ( "stdout" , "This is response: " + response ) ;
440436 int reference = getInt ( args , "variablesReference" , - 1 ) ;
441437 if ( reference == - 1 ) {
442438 SendErrorResponse ( response , 3009 , "variables: property 'variablesReference' is missing" , null , false , true ) ;
@@ -679,45 +675,8 @@ public override void Threads(Response response, dynamic args)
679675 SendResponse ( response , new ThreadsResponseBody ( threads ) ) ;
680676 }
681677
682- private static string ParseEvaluate ( string expression )
683- {
684- // Parse expressions created by using "Add Watch" in VS Code.
685- // Add Watch expressions examples:
686- // Done_PlayerController this.UnityEngine.GameObject gameObject.UnityEngine.SceneManagement.Scene scene.bool isLoaded
687- // Done_PlayerController this.UnityEngine.GameObject gameObject. Static members. Non-public members.int OffsetOfInstanceIDInCPlusPlusObject
688-
689- // Replace "Static members" and "Non-public members" with strings without spaces, so we can Split the string correctly.
690- var exp = expression . Replace ( "Static members." , "static-members" ) . Replace ( "Non-public members." , "non-public-members" ) ;
691- var expStrings = exp . Split ( ' ' ) ;
692- var parsedExpression = "" ;
693-
694- if ( expStrings . Length > 1 )
695- {
696- foreach ( var subexp in expStrings )
697- {
698- // Skip static and non public members substrings
699- if ( subexp . StartsWith ( "static-members" ) || subexp . StartsWith ( "non-public-members" ) )
700- continue ;
701-
702- // If array operator, remove previous '.'
703- if ( subexp . StartsWith ( "[" ) )
704- parsedExpression = parsedExpression . Substring ( 0 , parsedExpression . Length - 1 ) ;
705-
706- int index = subexp . IndexOf ( '.' ) ;
707-
708- if ( index > 0 )
709- parsedExpression += subexp . Substring ( 0 , index + 1 ) ;
710- }
711-
712- parsedExpression += expStrings . Last ( ) ;
713- Log . Write ( "Parsed Expression: '" + expression + "' -> '" + parsedExpression + "'" ) ;
714- }
715- return parsedExpression ;
716- }
717-
718678 public override void Evaluate ( Response response , dynamic args )
719679 {
720- SendOutput ( "stdout" , "Starting" ) ;
721680 var expression = getString ( args , "expression" ) ;
722681
723682 if ( expression == null ) {
@@ -734,18 +693,12 @@ public override void Evaluate(Response response, dynamic args)
734693 SendError ( response , "invalid expression" ) ;
735694 return ;
736695 }
737- SendOutput ( "stdout" , "Valid expression " + args ) ;
738696
739697 var evaluationOptions = m_DebuggerSessionOptions . EvaluationOptions . Clone ( ) ;
740698 evaluationOptions . EllipsizeStrings = false ;
741699 evaluationOptions . AllowMethodEvaluation = true ;
742- m_Session . Options . EvaluationOptions = evaluationOptions ;
743- m_Session . Options . ProjectAssembliesOnly = true ;
744- m_Session . Options . StepOverPropertiesAndOperators = false ;
745700 var val = Frame . GetExpressionValue ( expression , true ) ;
746- SendOutput ( "stdout" , "Sent expression" ) ;
747701 val . WaitHandle . WaitOne ( ) ;
748- SendOutput ( "stdout" , "Waiting" ) ;
749702
750703 var flags = val . Flags ;
751704 if ( flags . HasFlag ( ObjectValueFlags . Error ) || flags . HasFlag ( ObjectValueFlags . NotSupported ) )
0 commit comments