当前位置: 首页>>代码示例>>Java>>正文


Java DebugProcessImpl类代码示例

本文整理汇总了Java中com.intellij.debugger.engine.DebugProcessImpl的典型用法代码示例。如果您正苦于以下问题:Java DebugProcessImpl类的具体用法?Java DebugProcessImpl怎么用?Java DebugProcessImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DebugProcessImpl类属于com.intellij.debugger.engine包,在下文中一共展示了DebugProcessImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertToWrapper

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
private static Value convertToWrapper(EvaluationContextImpl context, PrimitiveValue value, String wrapperTypeName) throws
                                                                                                                          EvaluateException {
  final DebugProcessImpl process = context.getDebugProcess();
  final ClassType wrapperClass = (ClassType)process.findClass(context, wrapperTypeName, null);
  final String methodSignature = "(" + JVMNameUtil.getPrimitiveSignature(value.type().name()) + ")L" + wrapperTypeName.replace('.', '/') + ";";

  List<Method> methods = wrapperClass.methodsByName("valueOf", methodSignature);
  if (methods.size() == 0) { // older JDK version
    methods = wrapperClass.methodsByName(JVMNameUtil.CONSTRUCTOR_NAME, methodSignature);
  }
  if (methods.size() == 0) {
    throw new EvaluateException("Cannot construct wrapper object for value of type " + value.type() + ": Unable to find either valueOf() or constructor method");
  }

  return process.invokeMethod(context, wrapperClass, methods.get(0), Collections.singletonList(value));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BoxingEvaluator.java

示例2: actionPerformed

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) {
    return;
  }
  DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();

  final DebuggerSession session = context.getDebuggerSession();
  if(session != null && session.isAttached()) {
    final DebugProcessImpl process = context.getDebugProcess();
    if (process != null) {
      process.getManagerThread().invoke(new DebuggerCommandImpl() {
        protected void action() throws Exception {
          final List<ThreadState> threads = ThreadDumpAction.buildThreadStates(process.getVirtualMachineProxy());
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
              ExportToTextFileAction.export(project, ThreadDumpPanel.createToFileExporter(project, threads));
            }
          }, ModalityState.NON_MODAL);
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ExportThreadsAction.java

示例3: actionPerformed

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
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();
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ResumeThreadAction.java

示例4: actionPerformed

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();

  for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
    ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
    final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();

    if (!threadDescriptor.isFrozen()) {
      debugProcess.getManagerThread().schedule(new DebuggerCommandImpl(){
        @Override
        protected void action() throws Exception {
          debugProcess.createFreezeThreadCommand(thread).run();
          debuggerTreeNode.calcValue();
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:FreezeThreadAction.java

示例5: update

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void update(AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  DebugProcessImpl debugProcess = getDebuggerContext(e.getDataContext()).getDebugProcess();

  boolean visible = false;
  if (debugProcess != null) {
    visible = true;
    for (DebuggerTreeNodeImpl aSelectedNode : selectedNode) {
      NodeDescriptorImpl threadDescriptor = aSelectedNode.getDescriptor();
      if (!(threadDescriptor instanceof ThreadDescriptorImpl) || ((ThreadDescriptorImpl)threadDescriptor).isSuspended()) {
        visible = false;
        break;
      }
    }

  }

  e.getPresentation().setVisible(visible);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FreezeThreadAction.java

示例6: actionPerformed

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
  if(selectedNode == null) {
    return;
  }

  final NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
  if(!(descriptor instanceof ValueDescriptor)) {
    return;
  }

  DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
  if(debugProcess == null) {
    return;
  }

  debugProcess.getManagerThread().schedule(new NavigateCommand(debuggerContext, (ValueDescriptor)descriptor, debugProcess, e));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JumpToObjectAction.java

示例7: setSelected

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void setSelected(final AnActionEvent e, final boolean state) {
  if (!state) return;

  final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
  final List<JavaValue> values = getSelectedValues(e);
  final List<XValueNodeImpl> selectedNodes = XDebuggerTreeActionBase.getSelectedNodes(e.getDataContext());

  LOG.assertTrue(debuggerContext != null && !values.isEmpty());

  DebugProcessImpl process = debuggerContext.getDebugProcess();
  if (process == null) {
    return;
  }

  process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
      public void threadAction() {
        for (final XValueNodeImpl node : selectedNodes) {
          final XValue container = node.getValueContainer();
          if (container instanceof JavaValue) {
            ((JavaValue)container).setRenderer(myNodeRenderer, node);
          }
        }
      }
    }
  );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ViewAsGroup.java

示例8: update

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void update(final AnActionEvent event) {
  if(!DebuggerAction.isFirstStart(event)) {
    return;
  }

  myChildren = AnAction.EMPTY_ARRAY;
  final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(event.getDataContext());
  final List<JavaValue> values = getSelectedValues(event);
  if (values.isEmpty()) {
    event.getPresentation().setEnabledAndVisible(false);
    return;
  }

  final DebugProcessImpl process = debuggerContext.getDebugProcess();
  if (process == null) {
    event.getPresentation().setEnabled(false);
    return;
  }
  
  process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
    public void threadAction() {
      myChildren = calcChildren(values);
      DebuggerAction.enableAction(event, myChildren.length > 0);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ViewAsGroup.java

示例9: actionPerformed

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void actionPerformed(@NotNull final AnActionEvent e) {
  final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());

  if(debuggerContext != null) {
    final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
    if(debugProcess != null) {
      final List<JavaValue> selectedValues = ViewAsGroup.getSelectedValues(e);
      if (!selectedValues.isEmpty()) {
        debugProcess.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
            public void threadAction() {
              for (JavaValue selectedValue : selectedValues) {
                selectedValue.getDescriptor().setRenderer(null);
              }
              DebuggerAction.refreshViews(e);
            }
          });
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AutoRendererAction.java

示例10: createRequest

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
@Override
public void createRequest(@NotNull DebugProcessImpl debugProcess) {
  DebuggerManagerThreadImpl.assertIsManagerThread();
  // check is this breakpoint is enabled, vm reference is valid and there're no requests created yet
  if (!shouldCreateRequest(debugProcess)) {
    return;
  }

  if (!isValid()) {
    return;
  }

  SourcePosition position = getSourcePosition();
  if (position != null) {
    createOrWaitPrepare(debugProcess, position);
  }
  else {
    LOG.error("Unable to create request for breakpoint with null position: " + toString() + " at " + myXBreakpoint.getSourcePosition());
  }
  updateUI();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:BreakpointWithHighlighter.java

示例11: disableBreakpoints

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void disableBreakpoints(@NotNull final DebugProcessImpl debugProcess) {
  final List<Breakpoint> breakpoints = getBreakpoints();
  if (!breakpoints.isEmpty()) {
    final RequestManagerImpl requestManager = debugProcess.getRequestsManager();
    for (Breakpoint breakpoint : breakpoints) {
      breakpoint.markVerified(requestManager.isVerified(breakpoint));
      requestManager.deleteRequest(breakpoint);
    }
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        updateBreakpointsUI();
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BreakpointManager.java

示例12: acceptLocation

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
protected boolean acceptLocation(final DebugProcessImpl debugProcess, ReferenceType classType, final Location loc) {
  Method method = loc.method();
  // Some frameworks may create synthetic methods with lines mapped to user code, see IDEA-143852
  // if (DebuggerUtils.isSynthetic(method)) { return false; }
  if (isAnonymousClass(classType)) {
    if ((method.isConstructor() && loc.codeIndex() == 0) || method.isBridge()) return false;
  }
  return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
    @Override
    public Boolean compute() {
      SourcePosition position = debugProcess.getPositionManager().getSourcePosition(loc);
      if (position == null) return false;
      JavaLineBreakpointType type = getXBreakpointType();
      if (type == null) return true;
      return type.matchesPosition(LineBreakpoint.this, position);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LineBreakpoint.java

示例13: rebuild

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
public void rebuild(final DebuggerContextImpl context) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  final DebugProcessImpl process = context.getDebugProcess();
  if (process == null) {
    return; // empty context, no process available yet
  }
  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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DebuggerTree.java

示例14: DebuggerContextImpl

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
private DebuggerContextImpl(@Nullable DebuggerSession session,
                            @Nullable DebugProcessImpl debugProcess,
                            @Nullable SuspendContextImpl context,
                            ThreadReferenceProxyImpl threadProxy,
                            StackFrameProxyImpl frameProxy,
                            SourcePosition position,
                            PsiElement contextElement,
                            boolean initialized) {
  LOG.assertTrue(frameProxy == null || threadProxy == null || threadProxy == frameProxy.threadProxy());
  LOG.assertTrue(debugProcess != null || frameProxy == null && threadProxy == null);
  myDebuggerSession = session;
  myThreadProxy = threadProxy;
  myFrameProxy = frameProxy;
  myDebugProcess = debugProcess;
  mySourcePosition = position;
  mySuspendContext = context;
  myContextElement = contextElement;
  myInitialized = initialized;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DebuggerContextImpl.java

示例15: createScaledBitmap

import com.intellij.debugger.engine.DebugProcessImpl; //导入依赖的package包/类
@Nullable
private static Value createScaledBitmap(@NotNull EvaluationContextImpl context,
                                        @NotNull ObjectReference bitmap,
                                        @NotNull Dimension currentDimensions) throws EvaluateException {
  DebugProcessImpl debugProcess = context.getDebugProcess();
  Method createScaledBitmapMethod = DebuggerUtils
    .findMethod(bitmap.referenceType(), "createScaledBitmap", "(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;");
  if (createScaledBitmapMethod == null) {
    return null;
  }

  double s = Math.max(currentDimensions.getHeight(), currentDimensions.getWidth()) / MAX_DIMENSION;

  VirtualMachineProxyImpl vm = context.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);
  return debugProcess.invokeMethod(context, bitmap, createScaledBitmapMethod,
                                   Arrays.asList(bitmap, dstWidth, dstHeight, filter));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:BitmapEvaluator.java


注:本文中的com.intellij.debugger.engine.DebugProcessImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。