use of com.oracle.truffle.llvm.runtime.SulongStackTrace in project sulong by graalvm.
the class LLVMPrintStackTrace method doOp.
@TruffleBoundary
@Specialization
protected Object doOp() {
SulongStackTrace trace = getStackTrace("__sulong_print_stacktrace");
printCStackTrace(trace);
return null;
}
use of com.oracle.truffle.llvm.runtime.SulongStackTrace 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;
}
Aggregations