use of com.intellij.debugger.engine.DebugProcessImpl in project intellij-community by JetBrains.
the class DebuggerTree method rebuild.
public void rebuild(final DebuggerContextImpl context) {
ApplicationManager.getApplication().assertIsDispatchThread();
final DebugProcessImpl process = context.getDebugProcess();
if (process == null) {
// empty context, no process available yet
return;
}
myDebuggerContext = context;
saveState();
process.getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
getNodeFactory().setHistoryByContext(context);
}
@Override
public Priority getPriority() {
return Priority.NORMAL;
}
});
build(context);
}
use of com.intellij.debugger.engine.DebugProcessImpl in project intellij-community by JetBrains.
the class DebuggerTestCase method createRemoteProcess.
protected DebuggerSession createRemoteProcess(final int transport, final boolean serverMode, JavaParameters javaParameters) throws ExecutionException, InterruptedException, InvocationTargetException {
boolean useSockets = transport == DebuggerSettings.SOCKET_TRANSPORT;
RemoteConnection remoteConnection = new RemoteConnection(useSockets, "127.0.0.1", String.valueOf(DEFAULT_ADDRESS), serverMode);
String launchCommandLine = remoteConnection.getLaunchCommandLine();
launchCommandLine = StringUtil.replace(launchCommandLine, RemoteConnection.ONTHROW, "");
launchCommandLine = StringUtil.replace(launchCommandLine, RemoteConnection.ONUNCAUGHT, "");
launchCommandLine = StringUtil.replace(launchCommandLine, "suspend=n", "suspend=y");
println(launchCommandLine, ProcessOutputTypes.SYSTEM);
for (StringTokenizer tokenizer = new StringTokenizer(launchCommandLine); tokenizer.hasMoreTokens(); ) {
String token = tokenizer.nextToken();
javaParameters.getVMParametersList().add(token);
}
GeneralCommandLine commandLine = javaParameters.toCommandLine();
DebuggerSession debuggerSession;
if (serverMode) {
debuggerSession = attachVM(remoteConnection, false);
commandLine.createProcess();
} else {
commandLine.createProcess();
debuggerSession = attachVM(remoteConnection, true);
}
ProcessHandler processHandler = debuggerSession.getProcess().getProcessHandler();
DebugProcessImpl process = (DebugProcessImpl) DebuggerManagerEx.getInstanceEx(myProject).getDebugProcess(processHandler);
assertNotNull(process);
return debuggerSession;
}
use of com.intellij.debugger.engine.DebugProcessImpl in project intellij-community by JetBrains.
the class DescriptorTestCase method resume.
@Override
protected void resume(final SuspendContextImpl suspendContext) {
final DebugProcessImpl localProcess = suspendContext.getDebugProcess();
invokeRatherLater(new SuspendContextCommandImpl(suspendContext) {
@Override
public void contextAction() throws Exception {
flushDescriptors();
localProcess.getManagerThread().schedule(localProcess.createResumeCommand(suspendContext, Priority.LOW));
}
});
}
use of com.intellij.debugger.engine.DebugProcessImpl in project android by JetBrains.
the class ResolveTypedIntegerCommand method action.
@Override
public void action() {
// TODO: see if it is possible to cache this evaluation
// if (myIsEvaluated) return;
DebugProcess debugProcess = myEvaluationContext.getDebugProcess();
if (!(debugProcess instanceof DebugProcessImpl)) {
return;
}
final DebuggerContextImpl debuggerContext = ((DebugProcessImpl) debugProcess).getDebuggerContext();
PsiAnnotation annotation = ApplicationManager.getApplication().runReadAction(new Computable<PsiAnnotation>() {
@Override
public PsiAnnotation compute() {
try {
return getAnnotation(debuggerContext);
} catch (IndexNotReadyException e) {
return null;
}
}
});
if (annotation != null) {
ResourceIdResolver resolver = ServiceManager.getService(myEvaluationContext.getProject(), ResourceIdResolver.class);
DynamicResourceIdResolver resolver1 = new DynamicResourceIdResolver(myEvaluationContext, resolver);
myResult = AnnotationsRenderer.render(resolver1, annotation, ((IntegerValue) myValue).value());
}
evaluationResult("");
}
use of com.intellij.debugger.engine.DebugProcessImpl in project android by JetBrains.
the class BitmapEvaluatorProvider method downsizeBitmap.
@Override
public boolean downsizeBitmap(@NotNull Dimension currentDimensions) throws EvaluateException {
DebugProcessImpl debugProcess = myEvaluationContext.getDebugProcess();
Method createScaledBitmapMethod = DebuggerUtils.findMethod(myBitmap.referenceType(), "createScaledBitmap", "(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;");
if (createScaledBitmapMethod == null) {
return false;
}
double s = Math.max(currentDimensions.getHeight(), currentDimensions.getWidth()) / MAX_DIMENSION;
VirtualMachineProxyImpl vm = myEvaluationContext.getDebugProcess().getVirtualMachineProxy();
Value dstWidth = DebuggerUtilsEx.createValue(vm, "int", (int) (currentDimensions.getWidth() / s));
Value dstHeight = DebuggerUtilsEx.createValue(vm, "int", (int) (currentDimensions.getHeight() / s));
Value filter = DebuggerUtilsEx.createValue(vm, "boolean", Boolean.FALSE);
Value result = debugProcess.invokeMethod(myEvaluationContext, myBitmap, createScaledBitmapMethod, Arrays.asList(myBitmap, dstWidth, dstHeight, filter));
if (result != null) {
myBitmap = (ObjectReference) result;
}
return result != null;
}
Aggregations