- /* if no snapshot, we need to restore the initial state and replay the transitions */
- get_remote_app().restore_initial_state();
- on_restore_initial_state_signal(get_remote_app());
-
- /* Traverse the stack from the state at position start and re-execute the transitions */
- for (std::unique_ptr<State> const& state : stack_) {
- if (state == stack_.back()) /* If we are arrived on the target state, don't replay the outgoing transition */
- break;
- state->get_transition()->replay(get_remote_app());
- on_transition_replay_signal(state->get_transition(), get_remote_app());
- visited_states_count_++;
- }
- } // If no backtracing point, then the stack is empty and the exploration is over
+ /* Traverse the stack from the state at position start and re-execute the transitions */
+ for (std::shared_ptr<State> const& state : backtrack) {
+ if (state == backtrack.back()) /* If we are arrived on the target state, don't replay the outgoing transition */
+ break;
+ state->get_transition()->replay(get_remote_app());
+ on_transition_replay_signal(state->get_transition(), get_remote_app());
+ visited_states_count_++;
+ }
+ stack_ = backtrack;
+ XBT_VERB(">> Backtracked to %s", get_record_trace().to_string().c_str());