Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move MC_report() functions as static functions where they're used
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 13 Apr 2016 13:17:52 +0000 (15:17 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Wed, 13 Apr 2016 14:32:34 +0000 (16:32 +0200)
src/mc/ModelChecker.cpp
src/mc/mc_global.cpp
src/mc/mc_private.h

index b5baea4..0b7eadf 100644 (file)
@@ -30,7 +30,9 @@
 #include "src/mc/mc_private.h"
 #include "src/mc/mc_ignore.h"
 #include "src/mc/mc_exit.h"
+#include "src/mc/mc_record.h"
 #include "src/mc/Transition.hpp"
+#include "src/mc/Checker.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
 
@@ -182,6 +184,40 @@ void throw_socket_error(int fd)
   throw simgrid::xbt::errno_error(errno);
 }
 
+static void MC_report_crash(int status)
+{
+  XBT_INFO("**************************");
+  XBT_INFO("** CRASH IN THE PROGRAM **");
+  XBT_INFO("**************************");
+  if (WIFSIGNALED(status))
+    XBT_INFO("From signal: %s", strsignal(WTERMSIG(status)));
+  else if (WIFEXITED(status))
+    XBT_INFO("From exit: %i", WEXITSTATUS(status));
+  if (WCOREDUMP(status))
+    XBT_INFO("A core dump was generated by the system.");
+  else
+    XBT_INFO("No core dump was generated by the system.");
+  XBT_INFO("Counter-example execution trace:");
+  simgrid::mc::dumpRecordPath();
+  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+    XBT_INFO("%s", s.c_str());
+  simgrid::mc::session->logState();
+  XBT_INFO("Stack trace:");
+  mc_model_checker->process().dumpStack();
+}
+
+static void MC_report_assertion_error(void)
+{
+  XBT_INFO("**************************");
+  XBT_INFO("*** PROPERTY NOT VALID ***");
+  XBT_INFO("**************************");
+  XBT_INFO("Counter-example execution trace:");
+  simgrid::mc::dumpRecordPath();
+  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
+    XBT_INFO("%s", s.c_str());
+  simgrid::mc::session->logState();
+}
+
 bool ModelChecker::handle_message(char* buffer, ssize_t size)
 {
   s_mc_message_t base_message;
index 1213e1c..1b1afce 100644 (file)
@@ -284,40 +284,3 @@ void MC_process_clock_add(smx_process_t process, double amount)
 {
   simgrid::mc::processes_time[process->pid] += amount;
 }
-
-#if HAVE_MC
-void MC_report_assertion_error(void)
-{
-  XBT_INFO("**************************");
-  XBT_INFO("*** PROPERTY NOT VALID ***");
-  XBT_INFO("**************************");
-  XBT_INFO("Counter-example execution trace:");
-  simgrid::mc::dumpRecordPath();
-  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
-}
-
-void MC_report_crash(int status)
-{
-  XBT_INFO("**************************");
-  XBT_INFO("** CRASH IN THE PROGRAM **");
-  XBT_INFO("**************************");
-  if (WIFSIGNALED(status))
-    XBT_INFO("From signal: %s", strsignal(WTERMSIG(status)));
-  else if (WIFEXITED(status))
-    XBT_INFO("From exit: %i", WEXITSTATUS(status));
-  if (WCOREDUMP(status))
-    XBT_INFO("A core dump was generated by the system.");
-  else
-    XBT_INFO("No core dump was generated by the system.");
-  XBT_INFO("Counter-example execution trace:");
-  simgrid::mc::dumpRecordPath();
-  for (auto& s : mc_model_checker->getChecker()->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
-  XBT_INFO("Stack trace:");
-  mc_model_checker->process().dumpStack();
-}
-
-#endif
index ad31323..f5a789b 100644 (file)
@@ -71,9 +71,6 @@ XBT_PRIVATE void MC_show_deadlock(void);
 
 /********************************** Miscellaneous **********************************/
 
-XBT_PRIVATE void MC_report_assertion_error(void);
-XBT_PRIVATE void MC_report_crash(int status);
-
 SG_END_DECL()
 
 #ifdef __cplusplus