model: split printing into print_list() function
authorBrian Norris <banorris@uci.edu>
Thu, 3 May 2012 18:08:36 +0000 (11:08 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 3 May 2012 18:08:36 +0000 (11:08 -0700)
model.cc
model.h

index c829312166033342c8c8d077f0ec2acd63c33230..976b395db7889a123465d6ba89533503aa99a749 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -206,19 +206,25 @@ void ModelChecker::check_current_action(void)
 
 void ModelChecker::print_summary(void)
 {
-       action_list_t::iterator it;
-
        printf("\n");
-       printf("---------------------------------------------------------------------\n");
        printf("Number of executions: %d\n", num_executions);
-       printf("Total nodes created: %d\n\n", TreeNode::getTotalNodes());
+       printf("Total nodes created: %d\n", TreeNode::getTotalNodes());
 
        scheduler->print();
 
-       printf("Trace:\n\n");
+       print_list(action_trace);
+       printf("\n");
+
+}
+
+void ModelChecker::print_list(action_list_t *list)
+{
+       action_list_t::iterator it;
+
+       printf("---------------------------------------------------------------------\n");
+       printf("Trace:\n");
 
-       for (it = action_trace->begin(); it != action_trace->end(); it++) {
-               DBG();
+       for (it = list->begin(); it != list->end(); it++) {
                (*it)->print();
        }
        printf("---------------------------------------------------------------------\n");
diff --git a/model.h b/model.h
index 033bde21c0611e3fccbe6343655d17fc25d7ae21..2933f54cd7e5d4571c94f36ed4f652a3d34dcd1c 100644 (file)
--- a/model.h
+++ b/model.h
@@ -71,6 +71,8 @@ private:
        Backtrack * get_next_backtrack();
        void reset_to_initial_state();
 
+       void print_list(action_list_t *list);
+
        class ModelAction *current_action;
        Backtrack *exploring;
        thread_id_t nextThread;