Search in sources :

Example 1 with ThreadDeathRequest

use of com.sun.jdi.request.ThreadDeathRequest in project jdk8u_jdk by JetBrains.

the class VMConnection method setEventRequests.

private void setEventRequests(VirtualMachine vm) {
    EventRequestManager erm = vm.eventRequestManager();
    // Normally, we want all uncaught exceptions.  We request them
    // via the same mechanism as Commands.commandCatchException()
    // so the user can ignore them later if they are not
    // interested.
    // FIXME: this works but generates spurious messages on stdout
    //        during startup:
    //          Set uncaught java.lang.Throwable
    //          Set deferred uncaught java.lang.Throwable
    Commands evaluator = new Commands();
    evaluator.commandCatchException(new StringTokenizer("uncaught java.lang.Throwable"));
    ThreadStartRequest tsr = erm.createThreadStartRequest();
    tsr.enable();
    ThreadDeathRequest tdr = erm.createThreadDeathRequest();
    tdr.enable();
}
Also used : ThreadStartRequest(com.sun.jdi.request.ThreadStartRequest) ThreadDeathRequest(com.sun.jdi.request.ThreadDeathRequest) EventRequestManager(com.sun.jdi.request.EventRequestManager)

Example 2 with ThreadDeathRequest

use of com.sun.jdi.request.ThreadDeathRequest in project intellij-community by JetBrains.

the class DebugProcessEvents method vmAttached.

private void vmAttached() {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    LOG.assertTrue(!isAttached());
    if (myState.compareAndSet(State.INITIAL, State.ATTACHED)) {
        final VirtualMachineProxyImpl machineProxy = getVirtualMachineProxy();
        final EventRequestManager requestManager = machineProxy.eventRequestManager();
        if (machineProxy.canGetMethodReturnValues()) {
            myReturnValueWatcher = new MethodReturnValueWatcher(requestManager);
        }
        final ThreadStartRequest threadStartRequest = requestManager.createThreadStartRequest();
        threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
        threadStartRequest.enable();
        final ThreadDeathRequest threadDeathRequest = requestManager.createThreadDeathRequest();
        threadDeathRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
        threadDeathRequest.enable();
        // fill position managers
        ((DebuggerManagerImpl) DebuggerManager.getInstance(getProject())).getCustomPositionManagerFactories().map(factory -> factory.fun(this)).filter(Objects::nonNull).forEach(this::appendPositionManager);
        Stream.of(Extensions.getExtensions(PositionManagerFactory.EP_NAME, getProject())).map(factory -> factory.createPositionManager(this)).filter(Objects::nonNull).forEach(this::appendPositionManager);
        myDebugProcessDispatcher.getMulticaster().processAttached(this);
        createStackCapturingBreakpoints();
        // breakpoints should be initialized after all processAttached listeners work
        ApplicationManager.getApplication().runReadAction(() -> {
            XDebugSession session = getSession().getXDebugSession();
            if (session != null) {
                session.initBreakpoints();
            }
        });
        final String addressDisplayName = DebuggerBundle.getAddressDisplayName(getConnection());
        final String transportName = DebuggerBundle.getTransportName(getConnection());
        showStatusText(DebuggerBundle.message("status.connected", addressDisplayName, transportName));
        LOG.debug("leave: processVMStartEvent()");
    }
}
Also used : XDebugSession(com.intellij.xdebugger.XDebugSession) VirtualMachineProxyImpl(com.intellij.debugger.jdi.VirtualMachineProxyImpl) ThreadStartRequest(com.sun.jdi.request.ThreadStartRequest) ThreadDeathRequest(com.sun.jdi.request.ThreadDeathRequest) EventRequestManager(com.sun.jdi.request.EventRequestManager) MethodReturnValueWatcher(com.intellij.debugger.engine.requests.MethodReturnValueWatcher)

Aggregations

EventRequestManager (com.sun.jdi.request.EventRequestManager)2 ThreadDeathRequest (com.sun.jdi.request.ThreadDeathRequest)2 ThreadStartRequest (com.sun.jdi.request.ThreadStartRequest)2 MethodReturnValueWatcher (com.intellij.debugger.engine.requests.MethodReturnValueWatcher)1 VirtualMachineProxyImpl (com.intellij.debugger.jdi.VirtualMachineProxyImpl)1 XDebugSession (com.intellij.xdebugger.XDebugSession)1