From c09306ffd894f95be195723327d5b17dca73ebd1 Mon Sep 17 00:00:00 2001 From: Felix Rath Date: Fri, 22 May 2020 14:09:10 +0200 Subject: Implemented support for C++ Exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We implement the Itanium ABI unwinding base-API, and leave the C++-specific parts to libcxxabi. Co-authored-by: Lukas Wölfer --- tools/klee/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 87d7ccf9..61a9f164 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -782,6 +782,8 @@ static const char *modelledExternals[] = { "klee_warning", "klee_warning_once", "klee_stack_trace", + "_klee_eh_Unwind_RaiseException_impl", + "klee_eh_typeid_for", "llvm.dbg.declare", "llvm.dbg.value", "llvm.va_start", @@ -1267,9 +1269,17 @@ int main(int argc, char **argv, char **envp) { llvm::sys::path::append(LibcxxBC, KLEE_LIBCXX_BC_NAME); if (!klee::loadFile(LibcxxBC.c_str(), mainModule->getContext(), loadedModules, errorMsg)) - klee_error("error loading free standing support '%s': %s", - LibcxxBC.c_str(), errorMsg.c_str()); + klee_error("error loading libcxx '%s': %s", LibcxxBC.c_str(), + errorMsg.c_str()); klee_message("NOTE: Using libcxx : %s", LibcxxBC.c_str()); + + SmallString<128> EhCxxPath(Opts.LibraryDir); + llvm::sys::path::append(EhCxxPath, "libklee-eh-cxx.bca"); + if (!klee::loadFile(EhCxxPath.c_str(), mainModule->getContext(), + loadedModules, errorMsg)) + klee_error("error loading libklee-eh-cxx '%s': %s", EhCxxPath.c_str(), + errorMsg.c_str()); + #endif } -- cgit 1.4.1