Search in sources :

Example 11 with LLVMSymbol

use of com.oracle.truffle.llvm.runtime.LLVMSymbol in project graal by oracle.

the class LLVMDebuggerScopeFactory method toDebuggerScope.

@TruffleBoundary
private static LLVMDebuggerScopeEntries toDebuggerScope(LLVMScopeChain scope, DataLayout dataLayout, LLVMContext context) {
    final LLVMDebuggerScopeEntries entries = new LLVMDebuggerScopeEntries();
    LLVMScopeChain next = scope;
    while (next != null) {
        for (LLVMSymbol symbol : next.getScope().values()) {
            if (symbol.isGlobalVariable()) {
                LLVMGlobal global = symbol.asGlobalVariable();
                Object value = CommonNodeFactory.toGenericDebuggerValue(global.getPointeeType(), context.getSymbolUncached(global), dataLayout);
                entries.add(LLVMIdentifier.toGlobalIdentifier(global.getName()), value);
            }
        }
        next = next.getNext();
    }
    return entries;
}
Also used : LLVMScopeChain(com.oracle.truffle.llvm.runtime.LLVMScopeChain) LLVMGlobal(com.oracle.truffle.llvm.runtime.global.LLVMGlobal) LLVMSymbol(com.oracle.truffle.llvm.runtime.LLVMSymbol) TruffleBoundary(com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)

Aggregations

LLVMSymbol (com.oracle.truffle.llvm.runtime.LLVMSymbol)11 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)3 LLVMGlobal (com.oracle.truffle.llvm.runtime.global.LLVMGlobal)3 LLVMPointer (com.oracle.truffle.llvm.runtime.pointer.LLVMPointer)3 Specialization (com.oracle.truffle.api.dsl.Specialization)2 LLVMAlias (com.oracle.truffle.llvm.runtime.LLVMAlias)2 LLVMContext (com.oracle.truffle.llvm.runtime.LLVMContext)2 ArrayList (java.util.ArrayList)2 LLVMElemPtrSymbol (com.oracle.truffle.llvm.runtime.LLVMElemPtrSymbol)1 LLVMFunction (com.oracle.truffle.llvm.runtime.LLVMFunction)1 LLVMFunctionCode (com.oracle.truffle.llvm.runtime.LLVMFunctionCode)1 LLVMScope (com.oracle.truffle.llvm.runtime.LLVMScope)1 LLVMScopeChain (com.oracle.truffle.llvm.runtime.LLVMScopeChain)1 LLVMLinkerException (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)1 LLVMPolyglotException (com.oracle.truffle.llvm.runtime.except.LLVMPolyglotException)1 LLVMGlobalContainer (com.oracle.truffle.llvm.runtime.global.LLVMGlobalContainer)1 LLVMExpressionNode (com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode)1