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


Java XSuspendContext类代码示例

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


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

示例1: positionReached

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void positionReached(@NotNull final XSuspendContext suspendContext) {
  enableBreakpoints();
  mySuspendContext = suspendContext;
  myCurrentExecutionStack = suspendContext.getActiveExecutionStack();
  myCurrentStackFrame = myCurrentExecutionStack != null ? myCurrentExecutionStack.getTopFrame() : null;
  myIsTopFrame = true;
  myTopFramePosition = myCurrentStackFrame != null ? myCurrentStackFrame.getSourcePosition() : null;

  myPaused.set(true);

  updateExecutionPosition();

  if (myShowTabOnSuspend.compareAndSet(true, false)) {
    UIUtil.invokeLaterIfNeeded(new Runnable() {
      @Override
      public void run() {
        initSessionTab(null);
        showSessionTab();
      }
    });
  }

  myDispatcher.getMulticaster().sessionPaused();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:XDebugSessionImpl.java

示例2: clearExecutionStack

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
/**
 * Clears out the current execution stack while keeping the debug session alive. Useful for
 * breakpoint delete operations which result in no selected snapshots, requiring us to display an
 * empty stack in the UI, while keeping the debug session alive.
 */
public void clearExecutionStack() {
  SwingUtilities.invokeLater(
      new Runnable() {
        @Override
        public void run() {
          if (!getXDebugSession().isStopped()) {
            // Since there is no equivalent metaphor in traditional debug sessions, this simulates
            // the desired behavior of clearing the current context by setting the current
            // position
            // to an empty context
            getXDebugSession().positionReached(new XSuspendContext() {});
          }
        }
      });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:21,代码来源:CloudDebugProcess.java

示例3: runToPosition

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void runToPosition(@NotNull final XSourcePosition position, @Nullable XSuspendContext context)
{
	if(myPausedEventSet == null)
	{
		return;
	}

	myDebugThread.addCommand(virtualMachine ->
	{
		virtualMachine.stopStepRequests();

		DebugInformationResult debugOffset = virtualMachine.getDelegate().findDebugOffset(position.getFile().getPath(), position.getLine() + 1, -1);
		if(debugOffset != null)
		{
			EventRequestManager eventRequestManager = virtualMachine.eventRequestManager();

			BreakpointRequest breakpointRequest = eventRequestManager.createBreakpointRequest(debugOffset);
			breakpointRequest.putProperty(RUN_TO_CURSOR, Boolean.TRUE);
			breakpointRequest.enable();
		}
		return true;
	});
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:25,代码来源:MicrosoftDebugProcess.java

示例4: doResume

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Nullable
private XSuspendContext doResume() {
  if (!myPaused.getAndSet(false)) {
    return null;
  }

  myDispatcher.getMulticaster().beforeSessionResume();
  XSuspendContext context = mySuspendContext;
  mySuspendContext = null;
  myCurrentExecutionStack = null;
  myCurrentStackFrame = null;
  myTopFramePosition = null;
  myActiveNonLineBreakpoint = null;
  updateExecutionPosition();
  UIUtil.invokeLaterIfNeeded(() -> {
    if (mySessionTab != null) {
      mySessionTab.getUi().clearAttractionBy(XDebuggerUIConstants.LAYOUT_VIEW_BREAKPOINT_CONDITION);
    }
  });
  myDispatcher.getMulticaster().sessionResumed();
  return context;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:XDebugSessionImpl.java

示例5: getEvaluator

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Nullable
public static XDebuggerEvaluator getEvaluator(final XSuspendContext suspendContext) {
  XExecutionStack executionStack = suspendContext.getActiveExecutionStack();
  if (executionStack != null) {
    XStackFrame stackFrame = executionStack.getTopFrame();
    if (stackFrame != null) {
      return stackFrame.getEvaluator();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XDebuggerUtilImpl.java

示例6: getSuspendContext

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@NotNull
public XSuspendContext getSuspendContext() {
  if (mySuspendContext == null || myStack == null) {
    throw new IllegalStateException("GetSuspendContext could be called only after update");
  }

  return mySuspendContext;
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:9,代码来源:TheRXStack.java

示例7: showDebugInformation

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
private void showDebugInformation() {
  final XSourcePositionWrapper wrapper = new XSourcePositionWrapper(getCurrentPosition());
  final XLineBreakpoint<XBreakpointProperties> breakpoint = myBreakpoints.get(wrapper);

  final XDebugSession session = getSession();
  final XSuspendContext suspendContext = myStack.getSuspendContext();

  if (breakpoint != null) {
    final XDebuggerEvaluator evaluator = getActiveEvaluator();
    final XExpression conditionExpression = breakpoint.getConditionExpression();

    if (evaluator != null && conditionExpression != null) {
      evaluator.evaluate(
        conditionExpression,
        new EvaluationCallback(breakpoint, suspendContext),
        null
      );
    }
    else if (!session.breakpointReached(breakpoint, null, suspendContext)) { // 2nd arg is printed to console when breakpoint is reached
      resume();
    }
  }
  else {
    session.positionReached(suspendContext);

    myTempBreakpoints.remove(wrapper);
  }

  TheRGraphicsUtils.getGraphicsState(session.getProject()).refresh(true);
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:31,代码来源:TheRDebugProcess.java

示例8: positionReached

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void positionReached(@NotNull final XSuspendContext suspendContext) {
  enableBreakpoints();
  mySuspendContext = suspendContext;
  myCurrentExecutionStack = suspendContext.getActiveExecutionStack();
  myCurrentStackFrame = myCurrentExecutionStack != null ? myCurrentExecutionStack.getTopFrame() : null;
  myCurrentPosition = myCurrentStackFrame != null ? myCurrentStackFrame.getSourcePosition() : null;

  myPaused.set(true);

  if (myCurrentPosition != null) {
    myDebuggerManager.setActiveSession(this, myCurrentPosition, false, getPositionIconRenderer(true));
  }
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      if (myShowTabOnSuspend) {
        myShowTabOnSuspend = false;
        initSessionTab();
        showSessionTab();
      }
      mySessionTab.toFront();
      mySessionTab.getUi().attractBy(XDebuggerUIConstants.LAYOUT_VIEW_BREAKPOINT_CONDITION);
    }
  });
  myDispatcher.getMulticaster().sessionPaused();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:XDebugSessionImpl.java

示例9: runToPosition

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void runToPosition(@NotNull XSourcePosition position, XSuspendContext context) {
    String fileURL = XQueryBreakpointHandler.getFileUrl(position);
    int lineNumber = XQueryBreakpointHandler.getActualLineNumber(position.getLine());
    dbgpIde.breakpointSet(aLineBreakpoint(fileURL, lineNumber).withTemporary(true).build());
    dbgpIde.run();
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:8,代码来源:XQueryDebugProcess.java

示例10: resume

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void resume(@Nullable XSuspendContext context)
{
	myPausedEventSet = null;
	myDebugThread.addCommand(virtualMachine ->
	{
		virtualMachine.stopStepRequests();

		return true;
	});
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:12,代码来源:MicrosoftDebugProcess.java

示例11: runToPosition

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
@RequiredReadAction
public void runToPosition(@NotNull final XSourcePosition position, @Nullable XSuspendContext context)
{
	if(myPausedEventSet == null)
	{
		return;
	}

	myDebugThread.addCommand(virtualMachine ->
	{
		virtualMachine.stopStepRequests();

		try
		{
			final MonoBreakpointUtil.FindLocationResult result = MonoBreakpointUtil.findLocationsImpl(getSession().getProject(), virtualMachine, position.getFile(),
					position.getLine(), null, null);

			// no target for execution
			final Collection<Location> locations = result.getLocations();
			if(locations.isEmpty())
			{
				return true;
			}

			for(Location location : locations)
			{
				EventRequestManager eventRequestManager = virtualMachine.eventRequestManager();
				BreakpointRequest breakpointRequest = eventRequestManager.createBreakpointRequest(location);
				breakpointRequest.putProperty(RUN_TO_CURSOR, Boolean.TRUE);
				breakpointRequest.setEnabled(true);
			}
		}
		catch(TypeMirrorUnloadedException ignored)
		{
		}
		return true;
	});
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:40,代码来源:MonoDebugProcess.java

示例12: smartStepInto

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public <V extends XSmartStepIntoVariant> void smartStepInto(XSmartStepIntoHandler<V> handler, V variant) {
  if (!myDebugProcess.checkCanPerformCommands()) return;

  final XSuspendContext context = doResume();
  handler.startStepInto(variant, context);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:XDebugSessionImpl.java

示例13: breakpointReached

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
private boolean breakpointReached(@Nonnull final XBreakpoint<?> breakpoint, @Nullable String evaluatedLogExpression,
                                  @Nonnull XSuspendContext suspendContext, boolean doProcessing) {
  if (doProcessing) {
    if (breakpoint.isLogMessage()) {
      XSourcePosition position = breakpoint.getSourcePosition();
      OpenFileHyperlinkInfo hyperlinkInfo =
              position != null ? new OpenFileHyperlinkInfo(myProject, position.getFile(), position.getLine()) : null;
      printMessage(XDebuggerBundle.message("xbreakpoint.reached.text") + " ", XBreakpointUtil.getShortText(breakpoint), hyperlinkInfo);
    }

    if (evaluatedLogExpression != null) {
      printMessage(evaluatedLogExpression, null, null);
    }

    processDependencies(breakpoint);

    if (breakpoint.getSuspendPolicy() == SuspendPolicy.NONE) {
      return false;
    }
  }

  myActiveNonLineBreakpoint =
          (!(breakpoint instanceof XLineBreakpoint) || ((XLineBreakpoint)breakpoint).getType().canBeHitInOtherPlaces()) ? breakpoint : null;

  // set this session active on breakpoint, update execution position will be called inside positionReached
  myDebuggerManager.setCurrentSession(this);

  positionReachedInternal(suspendContext, true);

  if (doProcessing && breakpoint instanceof XLineBreakpoint<?> && ((XLineBreakpoint)breakpoint).isTemporary()) {
    handleTemporaryBreakpointHit(breakpoint);
  }
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:35,代码来源:XDebugSessionImpl.java

示例14: startStepOver

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void startStepOver(@Nullable XSuspendContext context) {
  muleDebuggerSession.nextStep();
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:5,代码来源:MuleDebugProcess.java

示例15: startStepInto

import com.intellij.xdebugger.frame.XSuspendContext; //导入依赖的package包/类
@Override
public void startStepInto(@Nullable XSuspendContext context) {
  muleDebuggerSession.nextStep();
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:5,代码来源:MuleDebugProcess.java


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