use of flash.tools.debugger.Location in project intellij-plugins by JetBrains.
the class DebugCLI method doShowLocations.
void doShowLocations() {
StringBuilder sb = new StringBuilder();
sb.append("Num Type Disp Enb Address What" + m_newline);
// our list of breakpoints
int count = breakpointCount();
for (int i = 0; i < count; i++) {
BreakAction b = breakpointAt(i);
int num = b.getId();
FieldFormat.formatLong(sb, num, 3);
sb.append(" breakpoint ");
if (b.isAutoDisable())
sb.append("dis ");
else if (b.isAutoDelete())
sb.append("del ");
else
sb.append("keep ");
if (b.isEnabled())
sb.append("y ");
else
sb.append("n ");
Iterator<Location> itr = b.getLocations().iterator();
while (itr.hasNext()) {
Location l = itr.next();
SourceFile file = l.getFile();
String funcName = (file == null) ? //$NON-NLS-1$
getLocalizationManager().getLocalizedTextString("unknownBreakpointLocation") : file.getFunctionNameForLine(m_session, l.getLine());
int offset = adjustOffsetForUnitTests((file == null) ? 0 : file.getOffsetForLine(l.getLine()));
//$NON-NLS-1$
sb.append("0x");
FieldFormat.formatLongToHex(sb, offset, 8);
sb.append(' ');
if (funcName != null) {
Map<String, Object> funcArgs = new HashMap<String, Object>();
//$NON-NLS-1$
funcArgs.put("functionName", funcName);
//$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("inFunctionAt", funcArgs));
}
sb.append(file.getName());
if (file != null) {
//$NON-NLS-1$
sb.append("#");
sb.append(file.getId());
}
sb.append(':');
sb.append(l.getLine());
try {
SwfInfo info = m_fileInfo.swfForFile(file);
Map<String, Object> swfArgs = new HashMap<String, Object>();
//$NON-NLS-1$
swfArgs.put("swf", FileInfoCache.shortNameOfSwf(info));
//$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("inSwf", swfArgs));
} catch (NullPointerException npe) {
// can't find the swf
//$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("nonRestorable"));
}
sb.append(m_newline);
if (itr.hasNext())
//$NON-NLS-1$
sb.append(" ");
}
}
out(sb.toString());
}
use of flash.tools.debugger.Location in project intellij-plugins by JetBrains.
the class DebugCLI method enableBreakpoint.
boolean enableBreakpoint(BreakAction a, boolean autoDisable, boolean autoDelete) throws NotConnectedException {
boolean retval = false;
// use the first location as a source file / line number template
Location l = a.getLocation();
if (l != null) {
LocationCollection col = enableBreak(l.getFile(), l.getLine());
if (!col.isEmpty()) {
a.setEnabled(true);
a.setLocations(col);
a.setAutoDisable(autoDisable);
a.setAutoDelete(autoDelete);
a.setSingleSwf(false);
a.setStatus(BreakAction.RESOLVED);
retval = true;
}
}
return retval;
}
use of flash.tools.debugger.Location in project intellij-plugins by JetBrains.
the class DebugCLI method getCurrentLocation.
Location getCurrentLocation() {
Location where = null;
try {
Frame[] ar = m_session.getFrames();
propertyPut(CURRENT_FRAME_DEPTH, (ar.length > 0) ? ar.length : 0);
where = ((ar.length > 0) ? ar[0].getLocation() : null);
} catch (PlayerDebugException pde) {
// where == null
}
return where;
}
use of flash.tools.debugger.Location in project intellij-plugins by JetBrains.
the class DebugCLI method doHome.
/**
* Bring the listing location back to the current frame
*/
void doHome() {
try {
Location l = getCurrentLocation();
SourceFile file = l.getFile();
int module = file.getId();
int line = l.getLine();
// now set it
setListingPosition(module, line);
} catch (NullPointerException npe) {
//$NON-NLS-1$
err(getLocalizationManager().getLocalizedTextString("currentLocationUnknown"));
}
}
use of flash.tools.debugger.Location 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));
}
Aggregations