From: Brian Norris Date: Tue, 10 Apr 2012 22:51:05 +0000 (-0700) Subject: model: add print_trace() function X-Git-Tag: pldi2013~558 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=675b681e98fa5dbfea23c1da5cead2370d8a27e2;p=model-checker.git model: add print_trace() function Prints out the current program trace. --- diff --git a/model.cc b/model.cc index 41dc44d..62b2925 100644 --- a/model.cc +++ b/model.cc @@ -39,6 +39,16 @@ void ModelChecker::check_current_action(void) DEBUG("trying to push NULL action...\n"); } +void ModelChecker::print_trace(void) +{ + std::list::iterator it; + + for (it = action_trace.begin(); it != action_trace.end(); it++) { + DBG(); + (*it)->print(); + } +} + ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value) { struct thread *t = thread_current(); diff --git a/model.h b/model.h index aa7e905..14d4372 100644 --- a/model.h +++ b/model.h @@ -41,6 +41,7 @@ public: void set_current_action(ModelAction *act) { current_action = act; } void check_current_action(void); + void print_trace(void); private: int used_thread_id;