Search in sources :

Example 11 with AbsentInformationException

use of com.sun.jdi.AbsentInformationException in project otertool by wuntee.

the class Testing method printBreakpointData.

public static void printBreakpointData(BreakpointEvent e) throws IncompatibleThreadStateException, AbsentInformationException {
    System.out.println(e.location());
    System.out.println("Line number: " + e.location().lineNumber());
    System.out.println("Code index: " + e.location().codeIndex());
    try {
        System.out.println("SourceName: " + e.location().sourceName());
    } catch (AbsentInformationException e1) {
        System.out.println("SourceName: UNAVAILABLE");
    }
    System.out.println("Declaration type: " + e.location().declaringType());
    System.out.println("Method: " + e.location().method());
    System.out.println("Stack frames:");
    for (StackFrame sf : e.thread().frames()) {
        System.out.println("\t" + sf.toString());
        System.out.println("\t   Visible Variables:");
        for (LocalVariable lv : sf.visibleVariables()) {
            System.out.println("\t\t--");
            System.out.println("\t\tName: " + lv.name());
            System.out.println("\t\tType: " + lv.typeName());
            Value lvValue = sf.getValue(lv);
            if (lvValue != null) {
                System.out.println("\t\tValue: " + lvValue);
                System.out.println("\t\tValue Type:" + lvValue.type());
                System.out.println("\t\ttoString: " + lv);
            }
        }
        System.out.println("\t   Argument Values:");
        for (Value lv : sf.getArgumentValues()) {
            System.out.println("\t\t--");
            System.out.println("\t\t" + lv.toString());
        }
    }
}
Also used : AbsentInformationException(com.sun.jdi.AbsentInformationException) StackFrame(com.sun.jdi.StackFrame) LocalVariable(com.sun.jdi.LocalVariable) Value(com.sun.jdi.Value)

Example 12 with AbsentInformationException

use of com.sun.jdi.AbsentInformationException in project intellij-community by JetBrains.

the class SpringLoadedPositionManager method findNested.

private static void findNested(Set<ReferenceType> res, ReferenceType fromClass, int line) {
    if (!fromClass.isPrepared())
        return;
    List<ReferenceType> nestedTypes = fromClass.nestedTypes();
    ReferenceType springLoadedGeneratedClass = null;
    for (ReferenceType nested : nestedTypes) {
        if (!nested.isPrepared())
            continue;
        if (isSpringLoadedGeneratedClass(fromClass, nested)) {
            if (springLoadedGeneratedClass == null || !springLoadedGeneratedClass.name().equals(nested.name())) {
                // Only latest generated classes should be used.
                springLoadedGeneratedClass = nested;
            }
        } else {
            findNested(res, nested, line);
        }
    }
    try {
        final int lineNumber = line + 1;
        ReferenceType effectiveRef = springLoadedGeneratedClass == null ? fromClass : springLoadedGeneratedClass;
        if (!effectiveRef.locationsOfLine(lineNumber).isEmpty()) {
            res.add(effectiveRef);
        }
    } catch (ObjectCollectedException | AbsentInformationException ignored) {
    }
}
Also used : ObjectCollectedException(com.sun.jdi.ObjectCollectedException) AbsentInformationException(com.sun.jdi.AbsentInformationException) ReferenceType(com.sun.jdi.ReferenceType)

Aggregations

AbsentInformationException (com.sun.jdi.AbsentInformationException)12 ReferenceType (com.sun.jdi.ReferenceType)4 LocalVariable (com.sun.jdi.LocalVariable)3 Location (com.sun.jdi.Location)3 NativeMethodException (com.sun.jdi.NativeMethodException)3 StackFrame (com.sun.jdi.StackFrame)3 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)2 ClassNotPreparedException (com.sun.jdi.ClassNotPreparedException)2 IncompatibleThreadStateException (com.sun.jdi.IncompatibleThreadStateException)2 InvalidStackFrameException (com.sun.jdi.InvalidStackFrameException)2 Method (com.sun.jdi.Method)2 Value (com.sun.jdi.Value)2 EventRequestManager (com.sun.jdi.request.EventRequestManager)2 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)2 DebuggerAbsentInformationException (org.eclipse.che.plugin.jdb.server.exceptions.DebuggerAbsentInformationException)2 Nullable (org.jetbrains.annotations.Nullable)2 Operation (org.netbeans.spi.debugger.jpda.EditorContext.Operation)2 SourcePosition (com.intellij.debugger.SourcePosition)1 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)1 DebuggerSession (com.intellij.debugger.impl.DebuggerSession)1