model: remove DEBUG action print
[c11tester.git] / model.cc
index feda416222de94f460291ee7f6a6ea15a21ddf22..29b88c1171aa1873d34b98a19dad43c0b6c6a035 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -2,6 +2,7 @@
 #include <algorithm>
 #include <mutex>
 #include <new>
+#include <stdarg.h>
 
 #include "model.h"
 #include "action.h"
@@ -419,9 +420,16 @@ bool ModelChecker::is_complete_execution() const
  * @param msg Descriptive message for the bug (do not include newline char)
  * @return True if bug is immediately-feasible
  */
-bool ModelChecker::assert_bug(const char *msg)
+bool ModelChecker::assert_bug(const char *msg, ...)
 {
-       priv->bugs.push_back(new bug_message(msg));
+       char str[800];
+
+       va_list ap;
+       va_start(ap, msg);
+       vsnprintf(str, sizeof(str), msg, ap);
+       va_end(ap);
+
+       priv->bugs.push_back(new bug_message(str));
 
        if (isfeasibleprefix()) {
                set_assert();
@@ -1492,8 +1500,6 @@ ModelAction * ModelChecker::check_current_action(ModelAction *curr)
        bool newly_explored = initialize_curr_action(&curr);
 
        DBG();
-       if (DBG_ENABLED())
-               curr->print();
 
        wake_up_sleeping_actions(curr);
 
@@ -3120,7 +3126,7 @@ void ModelChecker::run()
                                if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) {
                                        switch_from_master(thr);
                                        if (thr->is_waiting_on(thr))
-                                               assert_bug("Deadlock detected");
+                                               assert_bug("Deadlock detected (thread %u)", i);
                                }
                        }