@@ -128,8 +128,54 @@ public AD7DebugSession(Stream debugAdapterStdIn, Stream debugAdapterStdOut, List
128128 m_dataBreakpoints = new Dictionary < string , IDebugPendingBreakpoint2 > ( ) ;
129129 m_exceptionBreakpoints = new List < string > ( ) ;
130130 m_variableManager = new VariableManager ( ) ;
131+
132+ //Register sendInvalidate request
133+ Protocol . RegisterRequestType < SendInvalidateRequest , SendInvalidateArguments , SendInvalidateResponse > ( r => this . HandleSendInvalidateRequestAsync ( r ) ) ;
134+
131135 }
132136
137+ private void HandleSendInvalidateRequestAsync ( IRequestResponder < SendInvalidateArguments > responder )
138+ {
139+ InvalidatedEvent invalidated = new InvalidatedEvent ( ) ;
140+ SendInvalidateResponse response = new SendInvalidateResponse ( ) ;
141+
142+ // Setting the area and adding it to the result
143+ switch ( responder . Arguments . Areas . ToString ( ) )
144+ {
145+ case "Threads" :
146+ invalidated . Areas . Add ( InvalidatedAreas . Threads ) ;
147+ break ;
148+ case "Stacks" :
149+ invalidated . Areas . Add ( InvalidatedAreas . Stacks ) ;
150+ break ;
151+ case "Variables" :
152+ invalidated . Areas . Add ( InvalidatedAreas . Variables ) ;
153+ break ;
154+ case "Unknown" :
155+ invalidated . Areas . Add ( InvalidatedAreas . Unknown ) ;
156+ break ;
157+ default :
158+ invalidated . Areas . Add ( InvalidatedAreas . All ) ;
159+ break ;
160+ }
161+
162+ // Setting the StackFrameId if passed and adding to the result (and the 'threadId' is ignored).
163+ if ( null != responder . Arguments . StackFrameId )
164+ {
165+ invalidated . StackFrameId = responder . Arguments . StackFrameId ;
166+ }
167+
168+ // Setting the ThreadId if passed and adding to the result
169+ else if ( null != responder . Arguments . ThreadId )
170+ {
171+ invalidated . ThreadId = responder . Arguments . ThreadId ;
172+ }
173+
174+
175+ Protocol . SendEvent ( invalidated ) ;
176+ response . body . result = JsonConvert . SerializeObject ( responder ) + ", Success" ;
177+ responder . SetResponse ( response ) ;
178+ }
133179 #endregion
134180
135181 #region Utility
@@ -3874,4 +3920,31 @@ int IDebugSettingsCallback110.ShouldSuppressImplicitToStringCalls(out int pfSupp
38743920 }
38753921 }
38763922 }
3923+
3924+ internal class SendInvalidateRequest : DebugRequestWithResponse < SendInvalidateArguments , SendInvalidateResponse >
3925+ {
3926+
3927+ public SendInvalidateRequest ( ) : base ( "sendInvalidate" )
3928+ {
3929+ }
3930+ }
3931+
3932+ internal class SendInvalidateResponse : ResponseBody
3933+ {
3934+ public sealed class Body
3935+ {
3936+ public string result ;
3937+ }
3938+
3939+ public Body body = new Body ( ) ;
3940+ }
3941+
3942+ internal class SendInvalidateArguments : DebugRequestArguments
3943+ {
3944+
3945+ public string Areas { get ; set ; }
3946+ public int ? ThreadId { get ; set ; }
3947+ public int ? StackFrameId { get ; set ; }
3948+
3949+ }
38773950}
0 commit comments