Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Generate a message showing the path on crash of the model-checked
[simgrid.git] / src / mc / mc_global.cpp
index 3fe3677..68675a9 100644 (file)
@@ -585,6 +585,25 @@ void MC_report_assertion_error(void)
   MC_print_statistics(mc_stats);
 }
 
+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:");
+  MC_record_dump_path(mc_stack);
+  MC_dump_stack_safety(mc_stack);
+  MC_print_statistics(mc_stats);
+}
+
 void MC_invalidate_cache(void)
 {
   if (mc_model_checker)