use of com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugValue.Builder in project graal by oracle.
the class DebugExprDereferenceNode method getMemberAndType.
@TruffleBoundary
private Pair<Object, DebugExprType> getMemberAndType(Object executedPointerNode) {
if (executedPointerNode == null) {
throw DebugExprException.create(this, "debugObject to dereference is null");
}
try {
LLVMDebuggerValue llvmDebuggerValue = (LLVMDebuggerValue) executedPointerNode;
Object metaObj = llvmDebuggerValue.resolveMetaObject();
DebugExprType pointerType = DebugExprType.getTypeFromSymbolTableMetaObject(metaObj);
if (!pointerType.isPointer()) {
throw DebugExprException.create(this, llvmDebuggerValue + " is no pointer");
}
LLVMSourcePointerType llvmSourcePointerType = (LLVMSourcePointerType) metaObj;
LLVMSourceType llvmSourceType = llvmSourcePointerType.getBaseType();
LLVMDebugObject llvmPointerObject = (LLVMDebugObject) executedPointerNode;
Object llvmPointerValue = llvmPointerObject.getValue();
Builder builder = CommonNodeFactory.createDebugDeclarationBuilder();
LLVMDebugValue dereferencedValue = builder.build(llvmPointerValue);
LLVMDebugObject llvmDebugObject = LLVMDebugObject.create(llvmSourceType, 0L, dereferencedValue, null);
DebugExprType type = pointerType.getInnerType();
return Pair.create(type.parse(llvmDebugObject), type);
} catch (ClassCastException e) {
// throw cast exception of executedPointerNode (2 lines below)
}
throw DebugExprException.create(this, executedPointerNode + " cannot be casted to pointer ");
}
use of com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugValue.Builder in project graal by oracle.
the class DebugExprPointerCastNode method getMember.
private Object getMember(Object executedPointerNode, VirtualFrame frame) {
if (executedPointerNode == null) {
throw DebugExprException.create(this, "debugObject to dereference is null");
}
if (!typeNode.getLLVMSourceType(frame).isPointer()) {
throw DebugExprException.create(this, "%s is no pointer", executedPointerNode);
}
try {
LLVMSourcePointerType llvmSourcePointerType = (LLVMSourcePointerType) typeNode.getLLVMSourceType(frame);
LLVMDebugObject llvmPointerObject = (LLVMDebugObject) executedPointerNode;
Object llvmPointerValue = llvmPointerObject.getValue();
Builder builder = CommonNodeFactory.createDebugValueBuilder();
LLVMDebugValue pointerValue = builder.build(llvmPointerValue);
return LLVMDebugObject.create(llvmSourcePointerType, 0L, pointerValue, null);
} catch (ClassCastException e) {
throw DebugExprException.create(this, "%s cannot be casted to pointer ", executedPointerNode);
}
}
Aggregations