if (swtBrowser != null && !swtBrowser.isDisposed()) {
IPHPDebugTarget oldTarget = fTarget;
int oldcount = fUpdateCount;
fTarget = target;
DebugOutput debugOutput = null;
if (fTarget != null) {
if ((fTarget.isSuspended()) || (fTarget.isTerminated())
|| fTarget.isWaiting()) {
debugOutput = fTarget.getOutputBuffer();
fUpdateCount = debugOutput.getUpdateCount();
// check if output hasn't been updated
if (fTarget == oldTarget && fUpdateCount == oldcount) {
return;
}
} else {
// Not Suspended or Terminated
// the following is a fix for bug
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=205688
// if the target is not suspended or terminated fTarget
// should get back its old value
// so that in the next time the function is called it will
// not consider this target
// as it was already set to the view
fTarget = oldTarget;
return;
}
}
if (debugOutput != null) {
String contentType = debugOutput.getContentType();
if (contentType != null && !contentType.startsWith("text")) { //$NON-NLS-1$
return; // we don't show garbage anymore
}
String output = debugOutput.toString();
// Skip headers
int startIdx = output.indexOf("\r\n\r\n"); //$NON-NLS-1$
if (startIdx == -1) {
startIdx = output.indexOf("\r\n"); //$NON-NLS-1$
}