Search in sources :

Example 1 with VirtualMachineProxy

use of com.intellij.debugger.engine.jdi.VirtualMachineProxy in project intellij-community by JetBrains.

the class SpringLoadedPositionManagerFactory method usesSpringLoaded.

private static boolean usesSpringLoaded(@NotNull final DebugProcess process) {
    Boolean force = process.getProcessHandler().getUserData(FORCE_SPRINGLOADED);
    if (force == Boolean.TRUE)
        return true;
    try (AccessToken ignored = ApplicationManager.getApplication().acquireReadActionLock()) {
        JavaPsiFacade facade = JavaPsiFacade.getInstance(process.getProject());
        if (facade.findPackage("com.springsource.loaded") != null || facade.findPackage("org.springsource.loaded") != null) {
            return true;
        }
    }
    // Check spring loaded for remote process
    VirtualMachineProxy proxy = process.getVirtualMachineProxy();
    return !proxy.classesByName("com.springsource.loaded.agent.SpringLoadedAgent").isEmpty() || !proxy.classesByName("org.springsource.loaded.agent.SpringLoadedAgent").isEmpty();
}
Also used : JavaPsiFacade(com.intellij.psi.JavaPsiFacade) VirtualMachineProxy(com.intellij.debugger.engine.jdi.VirtualMachineProxy) AccessToken(com.intellij.openapi.application.AccessToken)

Example 2 with VirtualMachineProxy

use of com.intellij.debugger.engine.jdi.VirtualMachineProxy in project intellij-community by JetBrains.

the class FieldBreakpoint method createRequestForPreparedClass.

@Override
public void createRequestForPreparedClass(DebugProcessImpl debugProcess, ReferenceType refType) {
    VirtualMachineProxy vm = debugProcess.getVirtualMachineProxy();
    try {
        RequestManagerImpl manager = debugProcess.getRequestsManager();
        Field field = refType.fieldByName(getFieldName());
        if (field == null) {
            manager.setInvalid(this, DebuggerBundle.message("error.invalid.breakpoint.missing.field.in.class", getFieldName(), refType.name()));
            return;
        }
        if (isWatchModification() && vm.canWatchFieldModification()) {
            manager.enableRequest(manager.createModificationWatchpointRequest(this, field));
            LOG.debug("Modification request added");
        }
        if (isWatchAccess() && vm.canWatchFieldAccess()) {
            manager.enableRequest(manager.createAccessWatchpointRequest(this, field));
            if (LOG.isDebugEnabled()) {
                LOG.debug("Access request added field = " + field.name() + "; refType = " + refType.name());
            }
        }
    } catch (Exception ex) {
        LOG.debug(ex);
    }
}
Also used : VirtualMachineProxy(com.intellij.debugger.engine.jdi.VirtualMachineProxy) RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl) InvalidDataException(com.intellij.openapi.util.InvalidDataException) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) IndexNotReadyException(com.intellij.openapi.project.IndexNotReadyException)

Aggregations

VirtualMachineProxy (com.intellij.debugger.engine.jdi.VirtualMachineProxy)2 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)1 RequestManagerImpl (com.intellij.debugger.engine.requests.RequestManagerImpl)1 AccessToken (com.intellij.openapi.application.AccessToken)1 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 InvalidDataException (com.intellij.openapi.util.InvalidDataException)1 JavaPsiFacade (com.intellij.psi.JavaPsiFacade)1