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


Java JPDAThread.getCallStack方法代码示例

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


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

示例1: popToHere

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private static void popToHere (final CallStackFrame frame) {
    try {
        JPDAThread t = frame.getThread ();
        CallStackFrame[] stack = t.getCallStack ();
        int i, k = stack.length;
        if (k < 2) return ;
        for (i = 0; i < k; i++)
            if (stack [i].equals (frame)) {
                if (i > 0) {
                    stack [i - 1].popFrame ();
                }
                return;
            }
    } catch (AbsentInformationException ex) {
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DebuggingActionsProvider.java

示例2: navigateToCustomCode

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
final protected void navigateToCustomCode(final JPDAThread thread) {
    CallStackFrame callStackFrame = null;
    try {
        CallStackFrame[] callStack = thread.getCallStack();
        for (CallStackFrame csf : callStack) {
            String cn = csf.getClassName();
            if (JavaComponentInfo.isCustomType(cn)) {
                callStackFrame = csf;
                break;
            }
        }
    } catch (AbsentInformationException ex) {
    }
    if (callStackFrame != null) {
        ((JPDAThreadImpl) thread).getDebugger().setPreferredTopFrame(callStackFrame);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BaseComponentBreakpointImpl.java

示例3: checkForThreadJoin

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private ObjectVariable[] checkForThreadJoin(JPDAThread thread, ObjectVariable[] ownedMonitors) {
    CallStackFrame[] callStack;
    try {
        callStack = thread.getCallStack(0, 2);
    } catch (AbsentInformationException ex) {
        return ownedMonitors;
    }
    if (callStack.length < 2) {
        return ownedMonitors;
    }
    if (Thread.class.getName().equals(callStack[1].getClassName()) && "join".equals(callStack[1].getMethodName())) {    // NOI18N
        // This current thread is the "owned" monitor, it's joning the contended monitor.
        ObjectVariable[] ownedMonitorsWithThread = Arrays.copyOf(ownedMonitors, ownedMonitors.length + 1);
        ownedMonitorsWithThread[ownedMonitors.length] = (ObjectVariable) ((JPDAThreadImpl) thread).getDebugger().getVariable(((JPDAThreadImpl) thread).getThreadReference());
        return ownedMonitorsWithThread;
    } else {
        return ownedMonitors;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:DeadlockDetectorImpl.java

示例4: stopHere

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
/**
 * Test whether we should stop here according to the smart-stepping rules.
 */
StopOrStep stopHere(JPDAThread t) {
    CallStackFrame topFrame = null;
    try {
        CallStackFrame[] topFrameArr = t.getCallStack(0, 1);
        if (topFrameArr.length > 0) {
            topFrame = topFrameArr[0];
        }
    } catch (AbsentInformationException aiex) {}
    if (topFrame != null) {
        return getCompoundSmartSteppingListener().stopAt
                    (lookupProvider, topFrame, getSmartSteppingFilter());
    } else {
        return getCompoundSmartSteppingListener().stopHere
                    (lookupProvider, t, getSmartSteppingFilter()) ?
                StopOrStep.stop() : StopOrStep.skip();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:JPDADebuggerImpl.java

示例5: updateCurrentCallStackFrameNoFire

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private PropertyChangeEvent updateCurrentCallStackFrameNoFire (JPDAThread thread) {
    CallStackFrame oldSF;
    CallStackFrame newSF;
    if ((thread == null) || (thread.getStackDepth () < 1)) {
        newSF = null;
    } else {
        try {
            CallStackFrame[] csfs = thread.getCallStack(0, 1);
            if (csfs.length > 0) {
                newSF = csfs[0];
            } else {
                newSF = null;
            }
        } catch (AbsentInformationException e) {
            newSF = null;
        }
    }
    oldSF = setCurrentCallStackFrameNoFire(newSF);
    if (oldSF == newSF) {
        return null;
    } else {
        return new PropertyChangeEvent(this, PROP_CURRENT_CALL_STACK_FRAME,
                                       oldSF, newSF);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:JPDADebuggerImpl.java

示例6: getTopFrame

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private CallStackFrame getTopFrame(JPDAThread thread) {
    CallStackFrame callStackFrame;
    if (preferredTopFrame != null) {
        callStackFrame = preferredTopFrame;
        preferredTopFrame = null;
        return callStackFrame;
    }
    if ((thread == null) || (thread.getStackDepth () < 1)) {
        callStackFrame = null;
    } else {
        try {
            CallStackFrame[] csfs = thread.getCallStack(0, 1);
            if (csfs.length > 0) {
                callStackFrame = csfs[0];
            } else {
                callStackFrame = null;
            }
        } catch (AbsentInformationException e) {
            callStackFrame = null;
        }
    }
    return callStackFrame;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:JPDADebuggerImpl.java

示例7: setCurrentCallStackFrameIndex

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
static void setCurrentCallStackFrameIndex (
    JPDADebugger debuggerImpl,
    int index
) {
    try {
        JPDAThread t = debuggerImpl.getCurrentThread ();
        if (t == null) return;
        if (t.getStackDepth () <= index) return;
        final CallStackFrame csf = t.getCallStack (index, index + 1) [0];
        csf.makeCurrent ();
    } catch (AbsentInformationException e) {
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MakeCallerCurrentActionProvider.java

示例8: checkJSR45Languages

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private void checkJSR45Languages (JPDAThread t) {
    if (t.getStackDepth () > 0) {
        try {
            CallStackFrame[] frames = t.getCallStack (0, 1);
            if (frames.length < 1) {
                return ; // Internal error or disconnected
            }
            checkJSR45Languages(frames[0]);
        } catch (AbsentInformationException e) {
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:JPDADebuggerImpl.java

示例9: getTopFrame

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
static CallStackFrame getTopFrame(JPDAThread thread) {
    CallStackFrame topFrame = null;
    try {
        CallStackFrame[] topFrameArr = thread.getCallStack(0, 1);
        if (topFrameArr.length > 0) {
            topFrame = topFrameArr[0];
        }
    } catch (AbsentInformationException aiex) {}
    return topFrame;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:StepActionProvider.java

示例10: runAction

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public void runAction() {
    try {
        JPDAThread t = getDebuggerImpl ().getCurrentThread ();
        ((JPDAThreadImpl) t).accessLock.writeLock().lock();
        try {
            CallStackFrame[] frames = t.getCallStack (0, 2);
            if (frames.length > 1) {
                frames[0].popFrame ();
            }
        } finally {
            ((JPDAThreadImpl) t).accessLock.writeLock().unlock();
        }
    } catch (AbsentInformationException ex) {
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:PopToHereActionProvider.java

示例11: getTopFrame

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private static CallStackFrame getTopFrame(JPDAThread thread) {
    CallStackFrame topFrame = null;
    try {
        CallStackFrame[] topFrameArr = thread.getCallStack(0, 1);
        if (topFrameArr.length > 0) {
            topFrame = topFrameArr[0];
        }
    } catch (AbsentInformationException aiex) {}
    return topFrame;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:JPDAStepImpl.java

示例12: getThisVariable

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
/**
 * @return this variable of the JPDA thread.
 */
public final This getThisVariable(JPDAThread thread) throws AbsentInformationException {
    CallStackFrame frame = thread.getCallStack()[0];
    This thisVar = frame.getThisVariable();

    return thisVar;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:10,代码来源:EvaluationListener.java

示例13: run

import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
@Override
public void run () {
    CallStackFrame[] stack;
    SourcePath sourcePath;
    JPDAThread thread = null;
    synchronized (rp) {
        if (stackToAnnotate == null) {
            if (threadToAnnotate != null) {
                thread = threadToAnnotate;
            } else {
                return ; // Nothing to do
            }
        }
        stack = stackToAnnotate;
        sourcePath = sourcePathToAnnotate;
        threadToAnnotate = null;
        stackToAnnotate = null;
        sourcePathToAnnotate = null;
    }
    if (thread != null) {
        try {
            stack = thread.getCallStack();
        } catch (AbsentInformationException ex) {
            // Nothing to annotate
            return ;
        }

    }
    HashMap newAnnotations = new HashMap ();
    int i, k = stack.length;
    for (i = 1; i < k; i++) {

        // 1) check Line
        String language = stack[i].getDefaultStratum();                    
        String resourceName = EditorContextBridge.getRelativePath
            (stack[i], language);
        int lineNumber = stack[i].getLineNumber (language);
        String line = resourceName + lineNumber;

        // 2) line already annotated?
        if (newAnnotations.containsKey (line))
            continue;

        // 3) line has been annotated?
        Object da = stackAnnotations.remove (line);
        if (da == null) {
            // line has not been annotated -> create annotation
            da = sourcePath.annotate (stack[i], language);
        }

        // 4) add new line to hashMap
        if (da != null)
            newAnnotations.put (line, da);
    } // for

    // delete old anotations
    Iterator iter = stackAnnotations.values ().iterator ();
    while (iter.hasNext ())
        EditorContextBridge.getContext().removeAnnotation (
            iter.next ()
        );
    stackAnnotations = newAnnotations;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:64,代码来源:CurrentThreadAnnotationListener.java


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