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));
}
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());
}
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());
}
Aggregations