Search in sources :

Example 16 with ThreadReferenceProxyImpl

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

the class ThreadDescriptorImpl method calcRepresentation.

protected String calcRepresentation(EvaluationContextImpl context, DescriptorLabelListener labelListener) throws EvaluateException {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    ThreadReferenceProxyImpl thread = getThreadReference();
    try {
        myName = thread.name();
        ThreadGroupReferenceProxyImpl gr = getThreadReference().threadGroupProxy();
        final String grname = (gr != null) ? gr.name() : null;
        final String threadStatusText = DebuggerUtilsEx.getThreadStatusText(getThreadReference().status());
        //noinspection HardCodedStringLiteral
        if (grname != null && !"SYSTEM".equalsIgnoreCase(grname)) {
            return DebuggerBundle.message("label.thread.node.in.group", myName, thread.uniqueID(), threadStatusText, grname);
        }
        return DebuggerBundle.message("label.thread.node", myName, thread.uniqueID(), threadStatusText);
    } catch (ObjectCollectedException e) {
        return myName != null ? DebuggerBundle.message("label.thread.node.thread.collected", myName) : "";
    }
}
Also used : ObjectCollectedException(com.sun.jdi.ObjectCollectedException) ThreadReferenceProxyImpl(com.intellij.debugger.jdi.ThreadReferenceProxyImpl) ThreadGroupReferenceProxyImpl(com.intellij.debugger.jdi.ThreadGroupReferenceProxyImpl)

Example 17 with ThreadReferenceProxyImpl

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

the class ResumeThreadAction method actionPerformed.

public void actionPerformed(final AnActionEvent e) {
    DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
    final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
    final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
    if (debugProcess == null)
        return;
    //noinspection ConstantConditions
    for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
        final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl) debuggerTreeNode.getDescriptor());
        if (threadDescriptor.isSuspended()) {
            final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
            debugProcess.getManagerThread().schedule(new DebuggerCommandImpl() {

                @Override
                protected void action() throws Exception {
                    SuspendContextImpl suspendingContext = SuspendManagerUtil.getSuspendingContext(debugProcess.getSuspendManager(), thread);
                    if (suspendingContext != null) {
                        debugProcess.createResumeThreadCommand(suspendingContext, thread).run();
                    }
                    debuggerTreeNode.calcValue();
                }
            });
        }
    }
}
Also used : DebuggerTreeNodeImpl(com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl) DebuggerCommandImpl(com.intellij.debugger.engine.events.DebuggerCommandImpl) DebugProcessImpl(com.intellij.debugger.engine.DebugProcessImpl) ThreadDescriptorImpl(com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl) SuspendContextImpl(com.intellij.debugger.engine.SuspendContextImpl) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl) ThreadReferenceProxyImpl(com.intellij.debugger.jdi.ThreadReferenceProxyImpl)

Aggregations

ThreadReferenceProxyImpl (com.intellij.debugger.jdi.ThreadReferenceProxyImpl)17 DebuggerCommandImpl (com.intellij.debugger.engine.events.DebuggerCommandImpl)6 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)5 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)4 Project (com.intellij.openapi.project.Project)4 SuspendContextImpl (com.intellij.debugger.engine.SuspendContextImpl)3 StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)3 DebuggerTreeNodeImpl (com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl)3 ThreadDescriptorImpl (com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl)3 ObjectCollectedException (com.sun.jdi.ObjectCollectedException)3 DebuggerContextCommandImpl (com.intellij.debugger.engine.events.DebuggerContextCommandImpl)2 ThreadReferenceProxy (com.intellij.debugger.engine.jdi.ThreadReferenceProxy)2 VirtualMachineProxyImpl (com.intellij.debugger.jdi.VirtualMachineProxyImpl)2 StackCapturingLineBreakpoint (com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint)2 ThreadReference (com.sun.jdi.ThreadReference)2 Nullable (org.jetbrains.annotations.Nullable)2 Patches (com.intellij.Patches)1 JobScheduler (com.intellij.concurrency.JobScheduler)1 com.intellij.debugger (com.intellij.debugger)1 DebuggerBundle (com.intellij.debugger.DebuggerBundle)1