appendBreakInfo(sb);
//sb.append("unknown location");
}
else
{
SourceFile file = l.getFile();
name = file.getName();
line = l.getLine();
String funcName = file.getFunctionNameForLine(m_session, line) ;
// where were we last time
int lastModule = propertyGet(LIST_MODULE);
int lastDepth = propertyGet(LAST_FRAME_DEPTH);
int thisModule = file.getId();
int thisDepth = propertyGet(CURRENT_FRAME_DEPTH); // triggered via getCurrentLocation()
// mark where we stopped
propertyPut(LAST_FRAME_DEPTH, thisDepth);
// if we have changed our context or we are not spitting out source then dump our location
if (!postStep || lastModule != thisModule || lastDepth != thisDepth )
{
// is it a fault?
String reasonForHalting;
if ( reason == SuspendReason.Fault || reason == SuspendReason.StopRequest)
{
StringBuilder s = new StringBuilder();
appendReason(s, reason);
reasonForHalting = s.toString();
}
// if its a breakpoint add that information
else if ( (bp = enabledBreakpointIndexOf(l)) > -1 )
{
Map<String, Object> args = new HashMap<String, Object>();
args.put("breakpointNumber", Integer.toString(breakpointAt(bp).getId())); //$NON-NLS-1$
reasonForHalting = getLocalizationManager().getLocalizedTextString("hitBreakpoint", args); //$NON-NLS-1$
}
else
{
reasonForHalting = getLocalizationManager().getLocalizedTextString("executionHalted"); //$NON-NLS-1$
}
Map<String, Object> args = new HashMap<String, Object>();
args.put("reasonForHalting", reasonForHalting); //$NON-NLS-1$
args.put("fileAndLine", name + ':' + line); //$NON-NLS-1$
String formatString;
if (funcName != null)
{
args.put("functionName", funcName); //$NON-NLS-1$
formatString = "haltedInFunction"; //$NON-NLS-1$
}
else
{
formatString = "haltedInFile"; //$NON-NLS-1$
}
sb.append(getLocalizationManager().getLocalizedTextString(formatString, args));
if (!m_fullnameOption)
sb.append(m_newline);
}
// set current listing poistion and emit emacs trigger
setListingPosition(thisModule, line);
// dump our source line if not in emacs mode
if (!m_fullnameOption)
appendSource(sb, file.getId(), line, file.getLine(line), false);
}
}