Search in sources :

Example 6 with LLVMSourceSymbol

use of com.oracle.truffle.llvm.runtime.debug.LLVMSourceSymbol in project sulong by graalvm.

the class LLVMRuntimeDebugInformation method registerStaticDebugSymbols.

void registerStaticDebugSymbols(FunctionDefinition fn) {
    if (!isEnabled) {
        return;
    }
    for (SourceVariable local : fn.getSourceFunction().getVariables()) {
        if (local.isSingleDeclaration()) {
            final DbgDeclareInstruction dbg = local.getSingleDeclaration();
            FrameSlot frameSlot = null;
            if (dbg.getValue() instanceof AllocateInstruction) {
                frameSlot = frame.findFrameSlot(((AllocateInstruction) dbg.getValue()).getName());
            }
            if (frameSlot == null) {
                continue;
            }
            final LLVMSourceSymbol symbol = local.getSymbol();
            final LLVMFrameValueAccess alloc = factory.createDebugFrameValue(frameSlot, true);
            notNullableSlots.add(frameSlot);
            context.getSourceContext().registerFrameValue(symbol, alloc);
            local.addStaticValue();
        } else if (local.isSingleValue()) {
            final DbgValueInstruction dbg = local.getSingleValue();
            final MDExpression expr = dbg.getExpression();
            final SymbolImpl value = dbg.getValue();
            if (expr.getElementCount() != 0) {
                continue;
            }
            final boolean mustDereference = mustDereferenceValue(expr, local.getSourceType(), value);
            staticValueAccessVisitor.registerStaticAccess(local, value, mustDereference);
        }
    }
}
Also used : SourceVariable(com.oracle.truffle.llvm.parser.metadata.debuginfo.SourceVariable) DbgDeclareInstruction(com.oracle.truffle.llvm.parser.model.symbols.instructions.DbgDeclareInstruction) LLVMFrameValueAccess(com.oracle.truffle.llvm.runtime.debug.scope.LLVMFrameValueAccess) SymbolImpl(com.oracle.truffle.llvm.parser.model.SymbolImpl) AllocateInstruction(com.oracle.truffle.llvm.parser.model.symbols.instructions.AllocateInstruction) FrameSlot(com.oracle.truffle.api.frame.FrameSlot) DbgValueInstruction(com.oracle.truffle.llvm.parser.model.symbols.instructions.DbgValueInstruction) MDExpression(com.oracle.truffle.llvm.parser.metadata.MDExpression) LLVMSourceSymbol(com.oracle.truffle.llvm.runtime.debug.LLVMSourceSymbol)

Aggregations

LLVMSourceSymbol (com.oracle.truffle.llvm.runtime.debug.LLVMSourceSymbol)6 SymbolImpl (com.oracle.truffle.llvm.parser.model.SymbolImpl)3 FrameSlot (com.oracle.truffle.api.frame.FrameSlot)2 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)1 MDBaseNode (com.oracle.truffle.llvm.parser.metadata.MDBaseNode)1 MDExpression (com.oracle.truffle.llvm.parser.metadata.MDExpression)1 SourceVariable (com.oracle.truffle.llvm.parser.metadata.debuginfo.SourceVariable)1 GlobalAlias (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalAlias)1 GlobalConstant (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalConstant)1 GlobalValueSymbol (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalValueSymbol)1 GlobalVariable (com.oracle.truffle.llvm.parser.model.symbols.globals.GlobalVariable)1 AllocateInstruction (com.oracle.truffle.llvm.parser.model.symbols.instructions.AllocateInstruction)1 DbgDeclareInstruction (com.oracle.truffle.llvm.parser.model.symbols.instructions.DbgDeclareInstruction)1 DbgValueInstruction (com.oracle.truffle.llvm.parser.model.symbols.instructions.DbgValueInstruction)1 LLVMDebugObject (com.oracle.truffle.llvm.runtime.debug.LLVMDebugObject)1 LLVMDebugValue (com.oracle.truffle.llvm.runtime.debug.LLVMDebugValue)1 LLVMSourceStaticMemberType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceStaticMemberType)1 LLVMSourceType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceType)1 LLVMFrameValueAccess (com.oracle.truffle.llvm.runtime.debug.scope.LLVMFrameValueAccess)1 LLVMSourceLocation (com.oracle.truffle.llvm.runtime.debug.scope.LLVMSourceLocation)1