Remove backtrace on invalid ptr:

As the JIT does not provide debug symbols (yet), users see
only the call frames invoking the JIT - which is not helpful
as it is unrelated to their code.

We can turn this back on (possibly restricting to JIT frames)
once we emit debug symbols in the JIT.
This commit is contained in:
Axel Naumann 2022-01-11 12:43:57 +01:00 committed by jenkins
parent 52266ba5eb
commit c0eed39bfe

View File

@ -49,14 +49,16 @@ void* cling_runtime_internal_throwIfInvalidPointer(void* Interp, void* Expr,
cling::Interpreter* I = (cling::Interpreter*)Interp;
clang::Sema& S = I->getCI()->getSema();
// Print a nice backtrace.
I->getCallbacks()->PrintStackTrace();
// FIXME: re-enable once we have JIT debug symbols!
//I->getCallbacks()->PrintStackTrace();
throw cling::InvalidDerefException(&S, E,
cling::InvalidDerefException::DerefType::NULL_DEREF);
} else if (!cling::utils::isAddressValid(Arg)) {
cling::Interpreter* I = (cling::Interpreter*)Interp;
clang::Sema& S = I->getCI()->getSema();
// Print a nice backtrace.
I->getCallbacks()->PrintStackTrace();
// FIXME: re-enable once we have JIT debug symbols!
//I->getCallbacks()->PrintStackTrace();
throw cling::InvalidDerefException(&S, E,
cling::InvalidDerefException::DerefType::INVALID_MEM);
}