public override void Attach(Response response, dynamic arguments) { _attachMode = true; var host = DynamicHelper.GetString(arguments, "address"); if (host == null) { SendErrorResponse(response, 3007, "Property 'address' is missing or empty."); return; } // validate argument 'port' var port = DynamicHelper.GetInt(arguments, "port", -1); if (port == -1) { SendErrorResponse(response, 3008, "Property 'port' is missing."); return; } IPAddress address = Utilities.ResolveIPAddress(host); if (address == null) { SendErrorResponse(response, 3013, "Invalid address '{address}'.", new { address }); return; } Connect(address, port); SendResponse(response); }
public override void ExceptionInfo(Response response, dynamic arguments) => SendResponse( response, new ExceptionInfoResponseBody( string.Format( "{0} on thread 0x{1:x}", ExceptionHelper.Unwrap(_exception).GetType().Name, DynamicHelper.GetInt(arguments, "threadId")), ExceptionHelper.Unwrap(_exception).Message, details: CreateExceptionDetails(_exception)));
public override void Scopes(Response response, dynamic arguments) { int frameId = DynamicHelper.GetInt(arguments, "frameId", 0); Program.Log($"Getting frame ID {frameId}"); var frame = _frameHandles.Get(frameId, null); var scope = _frameScopes[frameId]; var scopes = _explorer.Scopes(Interpreter, frame, scope, _exception); SendResponse(response, new ScopesResponseBody(scopes)); }
public override void Variables(Response response, dynamic arguments) { int reference = DynamicHelper.GetInt(arguments, "variablesReference", -1); if (reference == -1) { SendErrorResponse(response, 3009, "variables: property 'variablesReference' is missing", null, false, true); return; } //Program.Log("[variables] Waiting for {0}", reference); WaitForSuspend(); //Program.Log("[variables] Done waiting for {0}", reference); var variables = _explorer.Variables(reference); SendResponse(response, new VariablesResponseBody(variables)); }