in flex/tools/idea-fdb-fix/idea_fdb_4.5.0.20967_fix/src/flex/tools/debugger/cli/DebugCLI.java [1919:2106]
void doInfoBreak() throws NotConnectedException
{
// waitTilHalted();
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 status = b.getStatus();
boolean isResolved = (status == BreakAction.RESOLVED);
Location l = b.getLocation();
SourceFile file = (l != null) ? l.getFile() : null;
String funcName = (file == null) ? null : file.getFunctionNameForLine(m_session, l.getLine()) ;
boolean singleSwf = b.isSingleSwf();
int cmdCount = b.getCommandCount();
int hits = b.getHits();
String cond = b.getConditionString();
boolean silent = b.isSilent();
int offset = adjustOffsetForUnitTests((file == null) ? 0 : file.getOffsetForLine(l.getLine()));
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 ");
sb.append("0x"); //$NON-NLS-1$
FieldFormat.formatLongToHex(sb, offset, 8);
sb.append(' ');
if (funcName != null)
{
Map<String, Object> args = new HashMap<String, Object>();
args.put("functionName", funcName); //$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("inFunctionAt", args)); //$NON-NLS-1$
}
if (file != null)
{
sb.append(file.getName());
if (isResolved && singleSwf)
{
sb.append("#"); //$NON-NLS-1$
sb.append(file.getId());
}
sb.append(':');
sb.append(l.getLine());
}
else
{
String expr = b.getBreakpointExpression();
if (expr != null)
sb.append(expr);
}
switch (status)
{
case BreakAction.UNRESOLVED:
sb.append(getLocalizationManager().getLocalizedTextString("breakpointNotYetResolved")); //$NON-NLS-1$
break;
case BreakAction.AMBIGUOUS:
sb.append(getLocalizationManager().getLocalizedTextString("breakpointAmbiguous")); //$NON-NLS-1$
break;
case BreakAction.NOCODE:
sb.append(getLocalizationManager().getLocalizedTextString("breakpointNoCode")); //$NON-NLS-1$
break;
}
// if a single swf break action then append more info
if (singleSwf && isResolved)
{
try
{
SwfInfo info = m_fileInfo.swfForFile(file);
Map<String, Object> swfArgs = new HashMap<String, Object>();
swfArgs.put("swf", FileInfoCache.nameOfSwf(info)); //$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("inSwf", swfArgs)); //$NON-NLS-1$
}
catch(NullPointerException npe)
{
// can't find the swf
sb.append(getLocalizationManager().getLocalizedTextString("nonRestorable")); //$NON-NLS-1$
}
}
sb.append(m_newline);
final String INDENT = " "; //$NON-NLS-1$
// state our condition if we have one
if (cond != null && cond.length() > 0)
{
sb.append(INDENT);
Map<String, Object> args = new HashMap<String, Object>();
args.put("breakpointCondition", cond ); //$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString(getLocalizationManager().getLocalizedTextString("stopOnlyIfConditionMet", args))); //$NON-NLS-1$
sb.append(m_newline);
}
// now if its been hit, lets state the fact
if (hits > 0)
{
sb.append(INDENT);
Map<String, Object> args = new HashMap<String, Object>();
args.put("count", Integer.toString(hits)); //$NON-NLS-1$
sb.append(getLocalizationManager().getLocalizedTextString("breakpointAlreadyHit", args)); //$NON-NLS-1$
sb.append(m_newline);
}
// silent?
if (silent)
{
sb.append(INDENT);
sb.append(getLocalizationManager().getLocalizedTextString("silentBreakpoint")+m_newline); //$NON-NLS-1$
}
// now if any commands are trailing then we pump them out
for(int j=0; j<cmdCount; j++)
{
sb.append(INDENT);
sb.append(b.commandAt(j));
sb.append(m_newline);
}
}
int wcount = watchpointCount();
for(int k = 0; k < wcount; k++)
{
WatchAction b = watchpointAt(k);
int id = b.getId();
FieldFormat.formatLong(sb, id, 4);
int flags = b.getKind();
switch(flags)
{
case WatchKind.READ:
sb.append("rd watchpoint ");
break;
case WatchKind.WRITE:
sb.append("wr watchpoint ");
break;
case WatchKind.READWRITE:
default:
sb.append("watchpoint ");
break;
}
sb.append("keep ");
sb.append("y ");
sb.append(" "); //$NON-NLS-1$
sb.append(b.getExpr());
sb.append(m_newline);
}
int ccount = catchpointCount();
for (int k = 0; k < ccount; k++)
{
CatchAction c = catchpointAt(k);
int id = c.getId();
FieldFormat.formatLong(sb, id, 4);
String typeToCatch = c.getTypeToCatch();
if (typeToCatch == null)
typeToCatch = "*"; //$NON-NLS-1$
sb.append("catch ");
sb.append("keep ");
sb.append("y ");
sb.append(" "); //$NON-NLS-1$
sb.append(typeToCatch);
sb.append(m_newline);
}
out(sb.toString());
}