Search in sources :

Example 6 with SwfInfo

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

the class DebugCLI method enableBreak.

/**
	 * Enable a breakpoint using the SourceFile as a template
	 * for the source file in which the breakpoint should be 
	 * set.
	 */
LocationCollection enableBreak(SourceFile f, int line) throws NotConnectedException {
    LocationCollection col = new LocationCollection();
    boolean singleSwfBreakpoint = m_fileInfo.isSwfFilterOn();
    SwfInfo swf = m_fileInfo.getSwfFilter();
    // set a breakpoint in a specific swf not all of them
    try {
        if (singleSwfBreakpoint) {
            Location l = findAndEnableBreak(swf, f, line);
            col.add(l);
        } else {
            // walk all swfs looking to add this breakpoint
            SwfInfo[] swfs = m_fileInfo.getSwfs();
            for (int i = 0; i < swfs.length; i++) {
                swf = swfs[i];
                if (swf != null) {
                    Location l = findAndEnableBreak(swf, f, line);
                    if (l != null)
                        col.add(l);
                }
            }
        }
    } catch (InProgressException ipe) {
        if (Trace.error)
            //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            Trace.trace(((swf == null) ? "SWF " : swf.getUrl()) + " still loading, breakpoint at " + f.getName() + ":" + line + " not set");
    }
    return col;
}
Also used : InProgressException(flash.tools.debugger.InProgressException) SwfInfo(flash.tools.debugger.SwfInfo) DSwfInfo(flash.tools.debugger.concrete.DSwfInfo) Location(flash.tools.debugger.Location)

Example 7 with SwfInfo

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

the class DebugCLI method isMetaDataAvailable.

/**
	 * Ask each swf if metadata processing is complete
	 */
public boolean isMetaDataAvailable() {
    boolean allLoaded = true;
    try {
        // we need to ask the session since our fileinfocache will hide the exception
        SwfInfo[] swfs = m_session.getSwfs();
        for (int i = 0; i < swfs.length; i++) {
            // check if our processing is finished.
            SwfInfo swf = swfs[i];
            if (swf != null && !swf.isProcessingComplete()) {
                allLoaded = false;
                break;
            }
        }
    } catch (NoResponseException nre) {
        // ok we still need to wait for player to read the swd in
        allLoaded = false;
    }
    // count the number of times we checked and it wasn't there
    if (!allLoaded) {
        int count = propertyGet(METADATA_NOT_AVAILABLE);
        count++;
        propertyPut(METADATA_NOT_AVAILABLE, count);
    } else {
        // success so we reset our attempt counter
        propertyPut(METADATA_ATTEMPTS, METADATA_RETRIES);
    }
    return allLoaded;
}
Also used : SwfInfo(flash.tools.debugger.SwfInfo) DSwfInfo(flash.tools.debugger.concrete.DSwfInfo) NoResponseException(flash.tools.debugger.NoResponseException)

Aggregations

SwfInfo (flash.tools.debugger.SwfInfo)7 DSwfInfo (flash.tools.debugger.concrete.DSwfInfo)6 Location (flash.tools.debugger.Location)5 SourceFile (flash.tools.debugger.SourceFile)5 InProgressException (flash.tools.debugger.InProgressException)4 HashMap (java.util.HashMap)4 NoResponseException (flash.tools.debugger.NoResponseException)2 SourceBreakpoint (com.nextgenactionscript.vscode.debug.requests.SourceBreakpoint)1 Breakpoint (com.nextgenactionscript.vscode.debug.responses.Breakpoint)1 SetBreakpointsResponseBody (com.nextgenactionscript.vscode.debug.responses.SetBreakpointsResponseBody)1 NotConnectedException (flash.tools.debugger.NotConnectedException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1