use of flash.tools.debugger.NoResponseException in project vscode-nextgenas by BowlerHatLLC.
the class SWFDebugSession method setBreakpoints.
public void setBreakpoints(Response response, SetBreakpointsRequest.SetBreakpointsArguments arguments) {
String path = arguments.source.path;
Path pathAsPath = Paths.get(path);
List<Breakpoint> breakpoints = new ArrayList<>();
for (int i = 0, count = arguments.breakpoints.length; i < count; i++) {
SourceBreakpoint sourceBreakpoint = arguments.breakpoints[i];
int sourceLine = sourceBreakpoint.line;
Breakpoint responseBreakpoint = new Breakpoint();
responseBreakpoint.line = sourceLine;
int fileId = -1;
try {
SwfInfo[] swfs = swfSession.getSwfs();
for (SwfInfo swf : swfs) {
SourceFile[] sourceFiles = swf.getSourceList(swfSession);
for (SourceFile sourceFile : sourceFiles) {
//file system case sensitivity.
if (pathAsPath.equals(Paths.get(sourceFile.getFullPath())) && (path.endsWith(FILE_EXTENSION_AS) || path.endsWith(FILE_EXTENSION_MXML))) {
fileId = sourceFile.getId();
break;
}
}
if (fileId != -1) {
break;
}
}
if (fileId == -1) {
//either the file was not found, or it has an unsupported
//extension
responseBreakpoint.verified = false;
} else {
Location breakpointLocation = swfSession.setBreakpoint(fileId, sourceLine);
if (breakpointLocation != null) {
//I don't know if the line could change, but might as well
//use the one returned by the location
responseBreakpoint.line = breakpointLocation.getLine();
responseBreakpoint.verified = true;
} else {
//setBreakpoint() may return null if the breakpoint could
//not be set. that's fine. the user will see that the
//breakpoint is not verified, so it's fine.
responseBreakpoint.verified = false;
}
}
} catch (InProgressException e) {
e.printStackTrace(System.err);
responseBreakpoint.verified = false;
} catch (NoResponseException e) {
e.printStackTrace(System.err);
responseBreakpoint.verified = false;
} catch (NotConnectedException e) {
e.printStackTrace(System.err);
responseBreakpoint.verified = false;
}
breakpoints.add(responseBreakpoint);
}
sendResponse(response, new SetBreakpointsResponseBody(breakpoints));
}
use of flash.tools.debugger.NoResponseException in project intellij-plugins by JetBrains.
the class DebugCLI method breakDisableRequest.
/**
* Notification that a breakpoint has been removed (or disabled)
* at the CLI level and we may need to remove it at the session level
*/
void breakDisableRequest(LocationCollection col) throws NotConnectedException {
// now let's comb the table looking to see if this breakpoint should
// be removed at the session level. Use the first entry as a template
// for which location we are talking about.
int at = 0;
boolean hit = false;
Location l = col.first();
do {
at = breakpointIndexOf(l, at);
if (at > -1) {
if (breakpointAt(at).isEnabled())
hit = true;
else
// our location match is not enabled but let's continue after the hit
at++;
}
} while (at > -1 && !hit);
// no one matches, so let's remove it at the session level
if (!hit) {
Iterator<Location> itr = col.iterator();
while (itr.hasNext()) {
l = itr.next();
try {
m_session.clearBreakpoint(l);
} catch (NoResponseException nre) {
}
}
}
}
use of flash.tools.debugger.NoResponseException 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;
}
Aggregations