resize_func_nodes( func_id + 1 );
FuncNode * func_node = func_nodes[func_id];
- func_node->init_predicate_tree_position(tid);
- func_node->init_inst_act_map(tid);
+ func_node->function_entry_handler(tid);
/* Add edges between FuncNodes */
if (last_entered_func_id != 0) {
}
/* Monitor the statuses of threads waiting for tid */
- monitor_waiting_thread(func_id, tid);
+ // monitor_waiting_thread(func_id, tid);
}
/* @param func_id a non-zero value */
if (last_func_id == func_id) {
FuncNode * func_node = func_nodes[func_id];
- func_node->set_predicate_tree_position(tid, NULL);
- func_node->reset_inst_act_map(tid);
-
- action_list_t * curr_act_list = func_act_lists->back();
-
- /* defer the processing of curr_act_list until the function has exits a few times
- * (currently twice) so that more information can be gathered to infer nullity predicates.
- */
- func_node->incr_exit_count();
- if (func_node->get_exit_count() >= 2) {
- SnapList<action_list_t *> * action_list_buffer = func_node->get_action_list_buffer();
- while (action_list_buffer->size() > 0) {
- action_list_t * act_list = action_list_buffer->back();
- action_list_buffer->pop_back();
- func_node->update_tree(act_list);
- }
-
- func_node->update_tree(curr_act_list);
- } else
- func_node->get_action_list_buffer()->push_front(curr_act_list);
+ func_node->function_exit_handler(tid);
(*thrd_func_list)[id].pop_back();
func_act_lists->pop_back();
return;
/* Monitor the statuses of threads waiting for tid */
- monitor_waiting_thread_counter(tid);
+ // monitor_waiting_thread_counter(tid);
/* Every write action should be processed, including
* nonatomic writes (which have no position) */
if (act->is_read()) {
func_node->update_inst_act_map(tid, act);
- Fuzzer * fuzzer = model->get_execution()->getFuzzer();
- Predicate * selected_branch = fuzzer->get_selected_child_branch(tid);
- func_node->set_predicate_tree_position(tid, selected_branch);
+// Fuzzer * fuzzer = model->get_execution()->getFuzzer();
+// Predicate * selected_branch = ((NewFuzzer *)fuzzer)->get_selected_child_branch(tid);
+// func_node->set_predicate_tree_position(tid, selected_branch);
}
-
+/*
if (act->is_write()) {
Predicate * curr_pred = func_node->get_predicate_tree_position(tid);
FuncInst * curr_inst = func_node->get_inst(act);
}
func_node->set_predicate_tree_position(tid, curr_pred);
}
+*/
+
+ func_node->update_tree(act);
}
/* Return the FuncNode given its func_id */
Thread * thread = model->get_thread(tid);
//model_print("** thread %d is woken up\n", thread->get_id());
- model->get_execution()->getFuzzer()->notify_paused_thread(thread);
+ ((NewFuzzer *)model->get_execution()->getFuzzer())->notify_paused_thread(thread);
}
index++;
}
void ModelHistory::add_waiting_thread(thread_id_t self_id,
-thread_id_t waiting_for_id, FuncNode * target_node, int dist)
+ thread_id_t waiting_for_id, FuncNode * target_node, int dist)
{
WaitObj * self_wait_obj = getWaitObj(self_id);
self_wait_obj->add_waiting_for(waiting_for_id, target_node, dist);
}
void ModelHistory::stop_waiting_for_node(thread_id_t self_id,
-thread_id_t waiting_for_id, FuncNode * target_node)
+ thread_id_t waiting_for_id, FuncNode * target_node)
{
WaitObj * self_wait_obj = getWaitObj(self_id);
bool thread_removed = self_wait_obj->remove_waiting_for_node(waiting_for_id, target_node);
// model_print("\tthread %d waits for nobody, wake up\n", self_id);
ModelExecution * execution = model->get_execution();
Thread * thread = execution->get_thread(self_id);
- execution->getFuzzer()->notify_paused_thread(thread);
+ ((NewFuzzer *)execution->getFuzzer())->notify_paused_thread(thread);
}
}
}
// model_print("\tthread %d waits for nobody, wake up\n", self_id);
ModelExecution * execution = model->get_execution();
Thread * thread = execution->get_thread(waited_by_id);
- execution->getFuzzer()->notify_paused_thread(thread);
+ ((NewFuzzer *)execution->getFuzzer())->notify_paused_thread(thread);
}
}
}
func_node->print_predicate_tree();
/*
- func_inst_list_mt * entry_insts = func_node->get_entry_insts();
- model_print("function %s has entry actions\n", func_node->get_func_name());
-
- mllnode<FuncInst*>* it;
- for (it = entry_insts->begin();it != NULL;it=it->getNext()) {
- FuncInst *inst = it->getVal();
- model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
- }
- */
+ func_inst_list_mt * entry_insts = func_node->get_entry_insts();
+ model_print("function %s has entry actions\n", func_node->get_func_name());
+
+ mllnode<FuncInst*>* it;
+ for (it = entry_insts->begin();it != NULL;it=it->getNext()) {
+ FuncInst *inst = it->getVal();
+ model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
+ }
+*/
}
}