Search in sources :

Example 6 with Frame

use of flash.tools.debugger.Frame in project vscode-nextgenas by BowlerHatLLC.

the class SWFDebugSession method stackTrace.

public void stackTrace(Response response, StackTraceRequest.StackTraceArguments arguments) {
    List<StackFrame> stackFrames = new ArrayList<>();
    try {
        Frame[] swfFrames = swfSession.getFrames();
        for (int i = 0, count = swfFrames.length; i < count; i++) {
            Frame swfFrame = swfFrames[i];
            Location location = swfFrame.getLocation();
            SourceFile file = location.getFile();
            StackFrame stackFrame = new StackFrame();
            stackFrame.id = i;
            stackFrame.name = swfFrame.getCallSignature();
            if (file != null) {
                Source source = new Source();
                source.name = file.getName();
                source.path = transformPath(file.getFullPath());
                stackFrame.source = source;
                stackFrame.line = location.getLine();
                stackFrame.column = 0;
            }
            stackFrames.add(stackFrame);
        }
    } catch (NotConnectedException e) {
    //ignore
    }
    sendResponse(response, new StackTraceResponseBody(stackFrames));
}
Also used : StackTraceResponseBody(com.nextgenactionscript.vscode.debug.responses.StackTraceResponseBody) StackFrame(com.nextgenactionscript.vscode.debug.responses.StackFrame) Frame(flash.tools.debugger.Frame) NotConnectedException(flash.tools.debugger.NotConnectedException) StackFrame(com.nextgenactionscript.vscode.debug.responses.StackFrame) ArrayList(java.util.ArrayList) SourceFile(flash.tools.debugger.SourceFile) SourceBreakpoint(com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint) Breakpoint(com.nextgenactionscript.vscode.debug.responses.Breakpoint) Source(com.nextgenactionscript.vscode.debug.requests.Source) Location(flash.tools.debugger.Location)

Example 7 with Frame

use of flash.tools.debugger.Frame in project intellij-plugins by JetBrains.

the class DebugCLI method doInfoStack.

void doInfoStack() throws PlayerDebugException {
    waitTilHalted();
    StringBuilder sb = new StringBuilder();
    Frame[] stack = m_session.getFrames();
    if (stack == null || stack.length == 0)
        //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("noStackAvailable"));
    else {
        boolean showThis = propertyGet(INFO_STACK_SHOW_THIS) == 1;
        for (int i = 0; i < stack.length; i++) {
            // keep spitting out frames until we can't
            Frame frame = stack[i];
            boolean valid = appendFrameInfo(sb, frame, i, showThis, true);
            sb.append(m_newline);
            if (!valid)
                break;
        }
    }
    /* dump it out */
    out(sb.toString());
}
Also used : Frame(flash.tools.debugger.Frame)

Example 8 with Frame

use of flash.tools.debugger.Frame in project intellij-plugins by JetBrains.

the class DebugCLI method doInfoLocals.

void doInfoLocals() throws PlayerDebugException {
    waitTilHalted();
    // dump a set of locals
    StringBuilder sb = new StringBuilder();
    // use our expression cache formatting routine
    try {
        // get the variables from the requested frame
        int num = propertyGet(DISPLAY_FRAME_NUMBER);
        Frame[] ar = m_session.getFrames();
        Frame ctx = ar[num];
        Variable[] vars = ctx.getLocals(m_session);
        for (int i = 0; i < vars.length; i++) {
            Variable v = vars[i];
            // see if variable is local
            if (v.isAttributeSet(VariableAttribute.IS_LOCAL)) {
                ExpressionCache.appendVariable(sb, v);
                sb.append(m_newline);
            }
        }
    } catch (NullPointerException npe) {
        //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("noLocals"));
    } catch (ArrayIndexOutOfBoundsException aix) {
        //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("notInValidFrame"));
    }
    out(sb.toString());
}
Also used : Frame(flash.tools.debugger.Frame) Variable(flash.tools.debugger.Variable)

Aggregations

Frame (flash.tools.debugger.Frame)8 SourceBreakpoint (com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint)3 Breakpoint (com.nextgenactionscript.vscode.debug.responses.Breakpoint)3 StackFrame (com.nextgenactionscript.vscode.debug.responses.StackFrame)3 Location (flash.tools.debugger.Location)3 PlayerDebugException (flash.tools.debugger.PlayerDebugException)3 ArrayList (java.util.ArrayList)3 SourceFile (flash.tools.debugger.SourceFile)2 Variable (flash.tools.debugger.Variable)2 Source (com.nextgenactionscript.vscode.debug.requests.Source)1 Scope (com.nextgenactionscript.vscode.debug.responses.Scope)1 ScopesResponseBody (com.nextgenactionscript.vscode.debug.responses.ScopesResponseBody)1 StackTraceResponseBody (com.nextgenactionscript.vscode.debug.responses.StackTraceResponseBody)1 Variable (com.nextgenactionscript.vscode.debug.responses.Variable)1 VariablesResponseBody (com.nextgenactionscript.vscode.debug.responses.VariablesResponseBody)1 NotConnectedException (flash.tools.debugger.NotConnectedException)1 Value (flash.tools.debugger.Value)1