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());
}
}
}
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) {
}
}
Aggregations