use of com.oracle.truffle.llvm.runtime.types.symbols.LocalVariableDebugInfo in project graal by oracle.
the class LLVMDebuggerScopeFactory method getVariables.
@TruffleBoundary
private LLVMDebuggerScopeEntries getVariables(Frame frame) {
if (symbols.isEmpty()) {
return LLVMDebuggerScopeEntries.EMPTY_SCOPE;
}
final LLVMDebuggerScopeEntries vars = new LLVMDebuggerScopeEntries(getName());
LLVMDispatchBasicBlockNode dispatchBlock = LLVMNode.getParent(node, LLVMDispatchBasicBlockNode.class);
if (frame != null && dispatchBlock != null) {
LocalVariableDebugInfo debugInfo = dispatchBlock.getDebugInfo();
Map<LLVMSourceSymbol, Object> localVariables = debugInfo.getLocalVariables(frame, node);
for (Map.Entry<LLVMSourceSymbol, Object> entry : localVariables.entrySet()) {
LLVMSourceSymbol symbol = entry.getKey();
if (symbols.contains(symbol)) {
vars.add(symbol.getName(), entry.getValue());
}
}
}
for (LLVMSourceSymbol symbol : symbols) {
if (!vars.contains(symbol.getName())) {
LLVMDebugObjectBuilder dbgVal = sourceContext.getStatic(symbol);
if (dbgVal == null) {
dbgVal = LLVMDebugObjectBuilder.UNAVAILABLE;
}
vars.add(convertIdentifier(symbol.getName(), context), dbgVal.getValue(symbol));
}
}
return vars;
}
Aggregations