From 675b681e98fa5dbfea23c1da5cead2370d8a27e2 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 10 Apr 2012 15:51:05 -0700 Subject: [PATCH] model: add print_trace() function Prints out the current program trace. --- model.cc | 10 ++++++++++ model.h | 1 + 2 files changed, 11 insertions(+) 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; -- 2.34.1