From 2fdd5aa8fc01e3d5c1ff66adf03b6dbb8e427ecd Mon Sep 17 00:00:00 2001 From: Andrea Mattavelli Date: Thu, 4 Aug 2016 17:00:01 +0100 Subject: Modified logging information to steer the usage of klee_message, klee_warning, and klee_error --- lib/Solver/MetaSMTSolver.cpp | 6 +++--- lib/Solver/Z3Solver.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Solver') diff --git a/lib/Solver/MetaSMTSolver.cpp b/lib/Solver/MetaSMTSolver.cpp index 411c07b1..6bfd79c1 100644 --- a/lib/Solver/MetaSMTSolver.cpp +++ b/lib/Solver/MetaSMTSolver.cpp @@ -397,9 +397,9 @@ MetaSMTSolverImpl::runAndGetCexForked( // "occasion" return a status when the process was terminated by a // signal, so test signal first. if (WIFSIGNALED(status) || !WIFEXITED(status)) { - fprintf(stderr, - "error: metaSMT did not return successfully (status = %d) \n", - WTERMSIG(status)); + klee_warning( + "error: metaSMT did not return successfully (status = %d) \n", + WTERMSIG(status)); return (SolverImpl::SOLVER_RUN_STATUS_INTERRUPTED); } diff --git a/lib/Solver/Z3Solver.cpp b/lib/Solver/Z3Solver.cpp index 96a7dafa..1cbca566 100644 --- a/lib/Solver/Z3Solver.cpp +++ b/lib/Solver/Z3Solver.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// #include "klee/Config/config.h" +#include "klee/Internal/Support/ErrorHandling.h" #ifdef ENABLE_Z3 #include "Z3Builder.h" #include "klee/Constraints.h" @@ -285,8 +286,7 @@ SolverImpl::SolverRunStatus Z3SolverImpl::handleSolverResponse( if (strcmp(reason, "unknown") == 0) { return SolverImpl::SOLVER_RUN_STATUS_FAILURE; } - llvm::errs() << "Unexpected solver failure. Reason is \"" << reason - << "\"\n"; + klee_warning("Unexpected solver failure. Reason is \"%s,\"\n", reason); abort(); } default: -- cgit 1.4.1