Search in sources :

Example 1 with TruffleStackTraceElement

use of com.oracle.truffle.api.TruffleStackTraceElement in project sulong by graalvm.

the class LLVMPrintStackTrace method getStackTrace.

private SulongStackTrace getStackTrace(String message) {
    Throwable t = new CThrowable(this, message);
    TruffleStackTraceElement.fillIn(t);
    List<TruffleStackTraceElement> ctrace = TruffleStackTraceElement.getStackTrace(t);
    SulongStackTrace trace = new SulongStackTrace(message);
    for (int i = 0; i < ctrace.size(); i++) {
        TruffleStackTraceElement element = ctrace.get(i);
        // ignore this call
        if (element.getLocation() == this) {
            assert i == 0;
            continue;
        }
        fillStackTrace(trace, element.getLocation());
    }
    return trace;
}
Also used : TruffleStackTraceElement(com.oracle.truffle.api.TruffleStackTraceElement) SulongStackTrace(com.oracle.truffle.llvm.runtime.SulongStackTrace)

Aggregations

TruffleStackTraceElement (com.oracle.truffle.api.TruffleStackTraceElement)1 SulongStackTrace (com.oracle.truffle.llvm.runtime.SulongStackTrace)1