Search in sources :

Example 1 with StackFrame

use of com.nextgenactionscript.vscode.debug.responses.StackFrame 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)

Aggregations

Source (com.nextgenactionscript.vscode.debug.requests.Source)1 SourceBreakpoint (com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint)1 Breakpoint (com.nextgenactionscript.vscode.debug.responses.Breakpoint)1 StackFrame (com.nextgenactionscript.vscode.debug.responses.StackFrame)1 StackTraceResponseBody (com.nextgenactionscript.vscode.debug.responses.StackTraceResponseBody)1 Frame (flash.tools.debugger.Frame)1 Location (flash.tools.debugger.Location)1 NotConnectedException (flash.tools.debugger.NotConnectedException)1 SourceFile (flash.tools.debugger.SourceFile)1 ArrayList (java.util.ArrayList)1