Search in sources :

Example 1 with ScopesResponseBody

use of com.nextgenactionscript.vscode.debug.responses.ScopesResponseBody in project vscode-nextgenas by BowlerHatLLC.

the class SWFDebugSession method scopes.

public void scopes(Response response, ScopesRequest.ScopesArguments arguments) {
    List<Scope> scopes = new ArrayList<>();
    int frameId = arguments.frameId;
    try {
        Frame[] swfFrames = swfSession.getFrames();
        if (frameId >= 0 && frameId < swfFrames.length) {
            Scope localScope = new Scope();
            localScope.name = "Locals";
            //this is a hacky way to store the frameId
            localScope.variablesReference = frameId * 10 + LOCAL_VARIABLES_REFERENCE;
            scopes.add(localScope);
        }
    } catch (PlayerDebugException e) {
    //ignore and return no scopes
    }
    sendResponse(response, new ScopesResponseBody(scopes));
}
Also used : ScopesResponseBody(com.nextgenactionscript.vscode.debug.responses.ScopesResponseBody) StackFrame(com.nextgenactionscript.vscode.debug.responses.StackFrame) Frame(flash.tools.debugger.Frame) Scope(com.nextgenactionscript.vscode.debug.responses.Scope) ArrayList(java.util.ArrayList) PlayerDebugException(flash.tools.debugger.PlayerDebugException) SourceBreakpoint(com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint) Breakpoint(com.nextgenactionscript.vscode.debug.responses.Breakpoint)

Aggregations

SourceBreakpoint (com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint)1 Breakpoint (com.nextgenactionscript.vscode.debug.responses.Breakpoint)1 Scope (com.nextgenactionscript.vscode.debug.responses.Scope)1 ScopesResponseBody (com.nextgenactionscript.vscode.debug.responses.ScopesResponseBody)1 StackFrame (com.nextgenactionscript.vscode.debug.responses.StackFrame)1 Frame (flash.tools.debugger.Frame)1 PlayerDebugException (flash.tools.debugger.PlayerDebugException)1 ArrayList (java.util.ArrayList)1