use of com.oracle.truffle.llvm.runtime.debug.LLVMDebugObject in project sulong by graalvm.
the class LLVMSourceScope method getVariables.
@TruffleBoundary
protected Object getVariables(Frame frame) {
final Map<String, LLVMDebugObject> vars = new HashMap<>();
if (frame != null && !symbols.isEmpty()) {
for (FrameSlot slot : frame.getFrameDescriptor().getSlots()) {
if (slot.getIdentifier() instanceof LLVMSourceSymbol && frame.getValue(slot) instanceof LLVMDebugValue) {
final LLVMSourceSymbol symbol = (LLVMSourceSymbol) slot.getIdentifier();
final LLVMDebugObject value = ((LLVMDebugValue) frame.getValue(slot)).getValue(symbol);
if (symbols.contains(symbol)) {
vars.put(symbol.getName(), value);
}
}
}
}
for (LLVMSourceSymbol symbol : symbols) {
if (!vars.containsKey(symbol.getName())) {
LLVMDebugValue dbgVal = context.getStatic(symbol);
if (dbgVal == null) {
final LLVMFrameValueAccess allocation = context.getFrameValue(symbol);
if (allocation != null && frame != null) {
dbgVal = allocation.getValue(frame);
}
}
if (dbgVal == null) {
dbgVal = LLVMDebugValue.UNAVAILABLE;
}
vars.put(symbol.getName(), dbgVal.getValue(symbol));
}
}
return new LLVMSourceScopeVariables(vars);
}
Aggregations