avoid status bar update on internal method invoke

This commit is contained in:
Vladimir Krivosheev
2014-03-12 19:10:24 +01:00
parent c22e314507
commit 62aa21ef27
@@ -908,8 +908,11 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
ClassNotLoadedException,
IncompatibleThreadStateException,
InvalidTypeException;
public E start(EvaluationContextImpl evaluationContext, Method method) throws EvaluateException {
return start(evaluationContext, method, false);
}
public E start(EvaluationContextImpl evaluationContext, Method method, boolean internalEvaluate) throws EvaluateException {
DebuggerManagerThreadImpl.assertIsManagerThread();
SuspendContextImpl suspendContext = evaluationContext.getSuspendContext();
SuspendManagerUtil.assertSuspendContext(suspendContext);
@@ -924,11 +927,11 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
final ThreadReference invokeThreadRef = invokeThread.getThreadReference();
myEvaluationDispatcher.getMulticaster().evaluationStarted(suspendContext);
beforeMethodInvocation(suspendContext, method);
beforeMethodInvocation(suspendContext, method, internalEvaluate);
Object resumeData = null;
try {
for (final SuspendContextImpl suspendingContext : suspendingContexts) {
for (SuspendContextImpl suspendingContext : suspendingContexts) {
final ThreadReferenceProxyImpl suspendContextThread = suspendingContext.getThread();
if (suspendContextThread != invokeThread) {
if (LOG.isDebugEnabled()) {
@@ -947,11 +950,11 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
while (true) {
try {
return invokeMethodAndFork(suspendContext);
}
}
catch (ClassNotLoadedException e) {
ReferenceType loadedClass;
try {
loadedClass = evaluationContext.isAutoLoadClasses()? loadClass(evaluationContext, e.className(), evaluationContext.getClassLoader()) : null;
loadedClass = evaluationContext.isAutoLoadClasses() ? loadClass(evaluationContext, e.className(), evaluationContext.getClassLoader()) : null;
}
catch (EvaluateException ignored) {
loadedClass = null;
@@ -998,7 +1001,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
LOG.debug("getVirtualMachine().clearCaches()");
}
getVirtualMachineProxy().clearCaches();
afterMethodInvocation(suspendContext);
afterMethodInvocation(suspendContext, internalEvaluate);
myEvaluationDispatcher.getMulticaster().evaluationFinished(suspendContext);
}
@@ -1118,9 +1121,16 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
public Value invokeMethod(final EvaluationContext evaluationContext, final ClassType classType,
final Method method,
final List args) throws EvaluateException {
return invokeMethod(evaluationContext, classType, method, args, false);
}
public Value invokeMethod(@NotNull EvaluationContext evaluationContext,
@NotNull final ClassType classType,
@NotNull final Method method,
final List args,
boolean internalEvaluate) throws EvaluateException {
final ThreadReference thread = getEvaluationThread(evaluationContext);
InvokeCommand<Value> invokeCommand = new InvokeCommand<Value>(args) {
return new InvokeCommand<Value>(args) {
@Override
protected Value invokeMethod(int invokePolicy, final List args) throws InvocationException,
ClassNotLoadedException,
@@ -1131,8 +1141,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
}
return classType.invokeMethod(thread, method, args, invokePolicy);
}
};
return invokeCommand.start((EvaluationContextImpl)evaluationContext, method);
}.start((EvaluationContextImpl)evaluationContext, method, internalEvaluate);
}
@Override
@@ -1179,25 +1188,29 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
clearCashes(suspendContext.getSuspendPolicy());
}
private void beforeMethodInvocation(SuspendContextImpl suspendContext, Method method) {
private void beforeMethodInvocation(SuspendContextImpl suspendContext, Method method, boolean internalEvaluate) {
if (LOG.isDebugEnabled()) {
LOG.debug(
"before invocation in thread " + suspendContext.getThread().name() + " method " + (method == null ? "null" : method.name()));
}
if (method != null) {
showStatusText(DebuggerBundle.message("progress.evaluating", DebuggerUtilsEx.methodName(method)));
}
else {
showStatusText(DebuggerBundle.message("title.evaluating"));
if (!internalEvaluate) {
if (method != null) {
showStatusText(DebuggerBundle.message("progress.evaluating", DebuggerUtilsEx.methodName(method)));
}
else {
showStatusText(DebuggerBundle.message("title.evaluating"));
}
}
}
private void afterMethodInvocation(SuspendContextImpl suspendContext) {
private void afterMethodInvocation(SuspendContextImpl suspendContext, boolean internalEvaluate) {
if (LOG.isDebugEnabled()) {
LOG.debug("after invocation in thread " + suspendContext.getThread().name());
}
showStatusText("");
if (!internalEvaluate) {
showStatusText("");
}
}
@Override