Search in sources :

Example 6 with RequestManagerImpl

use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.

the class MethodBreakpoint method createRequestForPreparedClassOriginal.

private void createRequestForPreparedClassOriginal(@NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType classType) {
    try {
        boolean hasMethod = false;
        for (Method method : classType.allMethods()) {
            String signature = method.signature();
            String name = method.name();
            if (getMethodName().equals(name) && mySignature.getName(debugProcess).equals(signature)) {
                hasMethod = true;
                break;
            }
        }
        if (!hasMethod) {
            debugProcess.getRequestsManager().setInvalid(this, DebuggerBundle.message("error.invalid.breakpoint.method.not.found", classType.name()));
            return;
        }
        RequestManagerImpl requestManager = debugProcess.getRequestsManager();
        if (isWatchEntry()) {
            MethodEntryRequest entryRequest = findRequest(debugProcess, MethodEntryRequest.class, this);
            if (entryRequest == null) {
                entryRequest = requestManager.createMethodEntryRequest(this);
            } else {
                entryRequest.disable();
            }
            //entryRequest.addClassFilter(myClassQualifiedName);
            // use addClassFilter(ReferenceType) in order to stop on subclasses also!
            entryRequest.addClassFilter(classType);
            debugProcess.getRequestsManager().enableRequest(entryRequest);
        }
        if (isWatchExit()) {
            MethodExitRequest exitRequest = findRequest(debugProcess, MethodExitRequest.class, this);
            if (exitRequest == null) {
                exitRequest = requestManager.createMethodExitRequest(this);
            } else {
                exitRequest.disable();
            }
            //exitRequest.addClassFilter(myClassQualifiedName);
            exitRequest.addClassFilter(classType);
            debugProcess.getRequestsManager().enableRequest(exitRequest);
        }
    } catch (Exception e) {
        LOG.debug(e);
    }
}
Also used : MethodExitRequest(com.sun.jdi.request.MethodExitRequest) MethodEntryRequest(com.sun.jdi.request.MethodEntryRequest) RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) IndexNotReadyException(com.intellij.openapi.project.IndexNotReadyException)

Example 7 with RequestManagerImpl

use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.

the class WildcardMethodBreakpoint method createRequest.

public void createRequest(DebugProcessImpl debugProcess) {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    if (!shouldCreateRequest(debugProcess)) {
        return;
    }
    if (isEmulated()) {
        createOrWaitPrepare(debugProcess, getClassPattern());
    } else {
        try {
            RequestManagerImpl requestManager = debugProcess.getRequestsManager();
            if (isWatchEntry()) {
                MethodEntryRequest entryRequest = MethodBreakpoint.findRequest(debugProcess, MethodEntryRequest.class, this);
                if (entryRequest == null) {
                    entryRequest = requestManager.createMethodEntryRequest(this);
                } else {
                    entryRequest.disable();
                }
                entryRequest.addClassFilter(getClassPattern());
                debugProcess.getRequestsManager().enableRequest(entryRequest);
            }
            if (isWatchExit()) {
                MethodExitRequest exitRequest = MethodBreakpoint.findRequest(debugProcess, MethodExitRequest.class, this);
                if (exitRequest == null) {
                    exitRequest = requestManager.createMethodExitRequest(this);
                } else {
                    exitRequest.disable();
                }
                exitRequest.addClassFilter(getClassPattern());
                debugProcess.getRequestsManager().enableRequest(exitRequest);
            }
        } catch (Exception e) {
            LOG.debug(e);
        }
    }
}
Also used : MethodExitRequest(com.sun.jdi.request.MethodExitRequest) MethodEntryRequest(com.sun.jdi.request.MethodEntryRequest) RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl) InvalidDataException(com.intellij.openapi.util.InvalidDataException) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) PatternSyntaxException(java.util.regex.PatternSyntaxException) AbsentInformationException(com.sun.jdi.AbsentInformationException)

Example 8 with RequestManagerImpl

use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.

the class BreakpointWithHighlighter method createLocationBreakpointRequest.

static void createLocationBreakpointRequest(@NotNull FilteredRequestor requestor, @Nullable Location location, @NotNull DebugProcessImpl debugProcess) {
    if (location != null) {
        RequestManagerImpl requestsManager = debugProcess.getRequestsManager();
        requestsManager.enableRequest(requestsManager.createBreakpointRequest(requestor, location));
    }
}
Also used : RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl)

Example 9 with RequestManagerImpl

use of com.intellij.debugger.engine.requests.RequestManagerImpl 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)

Example 10 with RequestManagerImpl

use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.

the class BreakpointWithHighlighter method calcIcon.

private Icon calcIcon(@Nullable DebugProcessImpl debugProcess) {
    final boolean muted = debugProcess != null && isMuted(debugProcess);
    if (!isEnabled()) {
        return getDisabledIcon(muted);
    }
    myInvalidMessage = "";
    if (!isValid()) {
        return getInvalidIcon(muted);
    }
    if (debugProcess == null) {
        return getSetIcon(muted);
    }
    final RequestManagerImpl requestsManager = debugProcess.getRequestsManager();
    final boolean isVerified = myCachedVerifiedState || requestsManager.isVerified(this);
    final String warning = requestsManager.getWarning(this);
    if (warning != null) {
        myInvalidMessage = warning;
        if (!isVerified) {
            return getInvalidIcon(muted);
        }
        return getVerifiedWarningsIcon(muted);
    }
    if (isVerified) {
        return getVerifiedIcon(muted);
    }
    return getSetIcon(muted);
}
Also used : RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl)

Aggregations

RequestManagerImpl (com.intellij.debugger.engine.requests.RequestManagerImpl)10 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)4 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)3 MethodEntryRequest (com.sun.jdi.request.MethodEntryRequest)3 MethodExitRequest (com.sun.jdi.request.MethodExitRequest)3 Requestor (com.intellij.debugger.requests.Requestor)2 InvalidDataException (com.intellij.openapi.util.InvalidDataException)2 DebuggerBundle (com.intellij.debugger.DebuggerBundle)1 DebuggerManagerEx (com.intellij.debugger.DebuggerManagerEx)1 SourcePosition (com.intellij.debugger.SourcePosition)1 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)1 DebuggerManagerThreadImpl (com.intellij.debugger.engine.DebuggerManagerThreadImpl)1 JVMName (com.intellij.debugger.engine.JVMName)1 JVMNameUtil (com.intellij.debugger.engine.JVMNameUtil)1 EvaluationContextImpl (com.intellij.debugger.engine.evaluation.EvaluationContextImpl)1 VirtualMachineProxy (com.intellij.debugger.engine.jdi.VirtualMachineProxy)1 DebuggerUtilsEx (com.intellij.debugger.impl.DebuggerUtilsEx)1 PositionUtil (com.intellij.debugger.impl.PositionUtil)1 MethodBytecodeUtil (com.intellij.debugger.jdi.MethodBytecodeUtil)1 Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)1