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


Java IThread.getTopStackFrame方法代码示例

本文整理汇总了Java中org.eclipse.debug.core.model.IThread.getTopStackFrame方法的典型用法代码示例。如果您正苦于以下问题:Java IThread.getTopStackFrame方法的具体用法?Java IThread.getTopStackFrame怎么用?Java IThread.getTopStackFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.debug.core.model.IThread的用法示例。


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

示例1: createStackFrame

import org.eclipse.debug.core.model.IThread; //导入方法依赖的package包/类
private IStackFrame createStackFrame(final IJiveDebugTarget target, final IJiveEvent event)
{
  try
  {
    final IThread thread = new MockThread(target, event);
    return thread.getTopStackFrame();
  }
  catch (final DebugException e)
  {
    throw new IllegalStateException("This should never occur since a mock object is returned.");
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:13,代码来源:SourceLookupFacility.java

示例2: run

import org.eclipse.debug.core.model.IThread; //导入方法依赖的package包/类
@Override
public void run() {
    try {
        currentStep = "launchEditorInDebug";
        //make a launch for debugging 
        debuggerTestUtils.launchEditorInDebug();

        //switch to debug perspective, because otherwise, when we hit a breakpoint it'll ask if we want to show it.
        debuggerTestUtils.switchToPerspective("org.eclipse.debug.ui.DebugPerspective");
        PyBreakpointRulerAction createAddBreakPointAction = debuggerTestUtils.createAddBreakPointAction(
                1);
        createAddBreakPointAction.run();

        currentStep = "waitForLaunchAvailable";
        ILaunch launch = debuggerTestUtils.waitForLaunchAvailable();
        PyDebugTarget target = (PyDebugTarget) debuggerTestUtils.waitForDebugTargetAvailable(launch);

        currentStep = "waitForSuspendedThread";
        IThread suspendedThread = debuggerTestUtils.waitForSuspendedThread(target);
        assertTrue(suspendedThread.getName().startsWith("MainThread"));
        IStackFrame topStackFrame = suspendedThread.getTopStackFrame();
        assertTrue("Was not expecting: " + topStackFrame.getName(),
                topStackFrame.getName().indexOf("debug_file.py:2") != 0);
        IVariable[] variables = topStackFrame.getVariables();

        HashSet<String> varNames = new HashSet<String>();
        for (IVariable variable : variables) {
            PyVariable var = (PyVariable) variable;
            varNames.add(var.getName());
        }
        HashSet<String> expected = new HashSet<String>();
        expected.add("Globals");
        expected.add("__doc__");
        expected.add("__file__");
        expected.add("__name__");
        expected.add("mod1");
        assertEquals(expected, varNames);

        assertTrue(target.canTerminate());
        target.terminate();

        finished = true;
    } catch (Throwable e) {
        debuggerTestUtils.failException = e;
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:47,代码来源:DebuggerTestWorkbench.java


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