use of com.sun.jdi.Value in project intellij-community by JetBrains.
the class LabelRenderer method calcLabel.
public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener labelListener) throws EvaluateException {
final Value value = descriptor.getValue();
String result;
final DebugProcess debugProcess = evaluationContext.getDebugProcess();
if (value != null) {
try {
final ExpressionEvaluator evaluator = myLabelExpression.getEvaluator(debugProcess.getProject());
if (!debugProcess.isAttached()) {
throw EvaluateExceptionUtil.PROCESS_EXITED;
}
EvaluationContext thisEvaluationContext = evaluationContext.createEvaluationContext(value);
Value labelValue = evaluator.evaluate(thisEvaluationContext);
result = DebuggerUtils.getValueAsString(thisEvaluationContext, labelValue);
} catch (final EvaluateException ex) {
throw new EvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression") + " " + ex.getMessage(), ex);
}
} else {
//noinspection HardCodedStringLiteral
result = "null";
}
return result;
}
use of com.sun.jdi.Value 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.Value in project android by JetBrains.
the class AndroidTypedIntegerRenderer method calcLabel.
@Override
public String calcLabel(ValueDescriptor descriptor, final EvaluationContext evaluationContext, final DescriptorLabelListener listener) throws EvaluateException {
final Value value = descriptor.getValue();
BatchEvaluator.getBatchEvaluator(evaluationContext.getDebugProcess()).invoke(new ResolveTypedIntegerCommand(descriptor, evaluationContext, value, listener));
return value.toString();
}
Aggregations