當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。