use of flash.tools.debugger.SourceFile in project intellij-plugins by JetBrains.
the class DebugCLI method module2ClassName.
/**
* Convert a module to class name. This is used
* by the ExpressionCache to find variables
* that live at royale package scope. That
* is variables such as mx.core.Component.
*/
public String module2ClassName(int moduleId) {
String pkg = null;
try {
SourceFile file = m_fileInfo.getFile(moduleId);
pkg = file.getPackageName();
} catch (Exception npe) {
// didn't work ignore it.
}
return pkg;
}
use of flash.tools.debugger.SourceFile in project intellij-plugins by JetBrains.
the class DebugCLI method listFilesMatching.
void listFilesMatching(StringBuffer sb, String match) {
SourceFile[] sourceFiles = m_fileInfo.getFiles(match);
for (int j = 0; j < sourceFiles.length; j++) {
SourceFile sourceFile = sourceFiles[j];
sb.append(sourceFile.getName());
sb.append('#');
sb.append(sourceFile.getId());
sb.append(m_newline);
}
}
use of flash.tools.debugger.SourceFile in project intellij-plugins by JetBrains.
the class DebugCLI method parseFileName.
private int parseFileName(String partialFileName) throws NoMatchException, AmbiguousException {
SourceFile[] sourceFiles = m_fileInfo.getFiles(partialFileName);
int nSourceFiles = sourceFiles.length;
if (nSourceFiles == 0) {
Map args = new HashMap();
//$NON-NLS-1$
args.put("name", partialFileName);
//$NON-NLS-1$
throw new NoMatchException(getLocalizationManager().getLocalizedTextString("noSourceFileWithSpecifiedName", args));
} else if (nSourceFiles > 1) {
//$NON-NLS-1$
String s = getLocalizationManager().getLocalizedTextString("ambiguousMatchingFilenames") + m_newline;
for (int i = 0; i < nSourceFiles; i++) {
SourceFile sourceFile = sourceFiles[i];
//$NON-NLS-1$ //$NON-NLS-2$
s += " " + sourceFile.getName() + "#" + sourceFile.getId();
if (i < nSourceFiles - 1)
s += m_newline;
}
throw new AmbiguousException(s);
}
return sourceFiles[0].getId();
}
use of flash.tools.debugger.SourceFile in project intellij-plugins by JetBrains.
the class DebugCLI method buildFileList.
void buildFileList(StringBuffer sb, boolean authoredFilesOnly) {
SourceFile[] ar = m_fileInfo.getFileList();
if (ar == null) {
//$NON-NLS-1$
err(getLocalizationManager().getLocalizedTextString("noSourceFilesFound"));
return;
}
Vector authoredFiles = new Vector();
Vector frameworkFiles = new Vector();
Vector syntheticFiles = new Vector();
Vector actionsFiles = new Vector();
for (int i = 0; i < ar.length; i++) {
SourceFile m = ar[i];
int fileType = getFileType(m);
int id = m.getId();
//$NON-NLS-1$
String entry = m.getName() + "#" + id;
switch(fileType) {
case SYNTHETIC_FILE:
syntheticFiles.add(entry);
break;
case FRAMEWORK_FILE:
frameworkFiles.add(entry);
break;
case ACTIONS_FILE:
actionsFiles.add(entry);
break;
case AUTHORED_FILE:
authoredFiles.add(entry);
break;
}
}
int wrapAt = propertyGet(FILE_LIST_WRAP);
if (!authoredFilesOnly) {
if (actionsFiles.size() > 0) {
appendStrings(sb, actionsFiles, (actionsFiles.size() > wrapAt));
}
if (frameworkFiles.size() > 0) {
//$NON-NLS-1$
sb.append("---" + m_newline);
appendStrings(sb, frameworkFiles, (frameworkFiles.size() > wrapAt));
}
if (syntheticFiles.size() > 0) {
//$NON-NLS-1$
sb.append("---" + m_newline);
appendStrings(sb, syntheticFiles, (syntheticFiles.size() > wrapAt));
}
//$NON-NLS-1$
sb.append("---" + m_newline);
}
appendStrings(sb, authoredFiles, (authoredFiles.size() > wrapAt));
}
use of flash.tools.debugger.SourceFile in project intellij-plugins by JetBrains.
the class DebugCLI method appendFrameInfo.
/**
* Spit out frame information for a given frame number
*/
boolean appendFrameInfo(StringBuffer sb, Frame ctx, int frameNumber, boolean showThis, boolean showFileId) throws PlayerDebugException {
boolean validFrame = true;
// some formatting properties
int i = frameNumber;
Location loc = ctx.getLocation();
SourceFile file = loc.getFile();
int line = loc.getLine();
//$NON-NLS-1$
String name = (file == null) ? "<null>" : file.getName();
String sig = ctx.getCallSignature();
String func = extractFunctionName(sig);
// file == null or line < 0 appears to be a terminator for stack info
if (file == null && line < 0) {
validFrame = false;
} else {
Variable[] var = ctx.getArguments(m_session);
Variable dis = ctx.getThis(m_session);
boolean displayArgs = (func != null) || (var != null);
sb.append('#');
FieldFormat.formatLong(sb, i, 3);
sb.append(' ');
if (showThis && dis != null) {
ExpressionCache.appendVariable(sb, dis);
//$NON-NLS-1$
sb.append(".");
}
if (func != null)
sb.append(func);
if (displayArgs) {
sb.append('(');
for (int j = 0; j < var.length; j++) {
Variable v = var[j];
sb.append(v.getName());
sb.append('=');
ExpressionCache.appendVariableValue(sb, v.getValue());
if ((j + 1) < var.length)
//$NON-NLS-1$
sb.append(", ");
}
//$NON-NLS-1$
sb.append(")");
//$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("atFilename"));
}
sb.append(name);
// if this file is currently being filtered put the source file id after it
if (file != null && (showFileId || !m_fileInfo.inFileList(file))) {
sb.append('#');
sb.append(file.getId());
}
sb.append(':');
sb.append(line);
}
return validFrame;
}
Aggregations