本文整理汇总了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.");
}
}
示例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;
}
}