use of com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceSymbol in project graal by oracle.
the class DebugInfoCache method getSourceSymbol.
LLVMSourceSymbol getSourceSymbol(MDBaseNode mdVariable, boolean isStatic) {
LLVMSourceSymbol lookup = parsedVariables.get(mdVariable);
if (lookup != null) {
return lookup;
}
LLVMSourceLocation location = scopeBuilder.buildLocation(mdVariable);
final LLVMSourceType type = typeExtractor.parseType(mdVariable);
final String varName = MDNameExtractor.getName(mdVariable);
final LLVMSourceSymbol symbol = LLVMSourceSymbol.create(varName, location, type, isStatic);
parsedVariables.put(mdVariable, symbol);
if (location != null) {
// this is currently the line/column where the symbol was declared, we want the
// scope
location = location.getParent();
}
if (location != null) {
location.addSymbol(symbol);
}
return symbol;
}
use of com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceSymbol in project graal by oracle.
the class DebugInfoModuleProcessor method processSymbols.
private static void processSymbols(List<? extends GlobalValueSymbol> list, DebugInfoCache cache, ModelModule irModel) {
for (GlobalValueSymbol global : list) {
MDBaseNode mdGlobal = getDebugInfo(global);
if (mdGlobal != null) {
final boolean isGlobal = !(mdGlobal instanceof MDLocalVariable);
final LLVMSourceSymbol symbol = cache.getSourceSymbol(mdGlobal, isGlobal);
if (symbol != null) {
irModel.getSourceGlobals().put(symbol, global);
global.setSourceSymbol(symbol);
}
if (mdGlobal instanceof MDGlobalVariableExpression) {
mdGlobal = ((MDGlobalVariableExpression) mdGlobal).getGlobalVariable();
}
if (mdGlobal instanceof MDGlobalVariable) {
final MDBaseNode declaration = ((MDGlobalVariable) mdGlobal).getStaticMemberDeclaration();
if (declaration != MDVoidNode.INSTANCE) {
final LLVMSourceType sourceType = cache.parseType(declaration);
if (sourceType instanceof LLVMSourceStaticMemberType) {
irModel.getSourceStaticMembers().put((LLVMSourceStaticMemberType) sourceType, global);
}
}
}
}
}
}
use of com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceSymbol in project graal by oracle.
the class LLVMRuntimeDebugInformation method getLocalVariablesForIndex.
private Map<LLVMSourceSymbol, Object> getLocalVariablesForIndex(Frame frame, int blockId, int index) {
initializePredecessors();
initializeDebugInfo();
HashMap<LLVMSourceSymbol, List<LocalVarDebugInfo>> info = applyBlockInfo(blockEntryDebugInfo.get(blockId), blockId, index);
HashMap<LLVMSourceSymbol, Object> values = new HashMap<>();
for (Map.Entry<LLVMSourceSymbol, List<LocalVarDebugInfo>> entry : info.entrySet()) {
// process all debug info entries for this variable
LLVMDebugObjectBuilder builder = null;
for (LocalVarDebugInfo di : entry.getValue()) {
builder = di.process(builder, frame);
}
values.put(entry.getKey(), builder.getValue(entry.getKey()));
}
return values;
}
use of com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceSymbol in project graal by oracle.
the class DebugInfoFunctionProcessor method getVariable.
private SourceVariable getVariable(FunctionDefinition function, VoidCallInstruction call, int mdLocalArgIndex, int mdExprArgIndex) {
final SymbolImpl varSymbol = getArg(call, mdLocalArgIndex);
if (varSymbol instanceof MetadataSymbol) {
MDBaseNode mdLocal = ((MetadataSymbol) varSymbol).getNode();
LLVMSourceSymbol symbol = cache.getSourceSymbol(mdLocal, false);
attachSourceArgumentInformation(function, call, mdLocalArgIndex, mdExprArgIndex);
return function.getSourceFunction().getLocal(symbol);
}
return null;
}
Aggregations