bool hasResult(frame &cur_frame, uint64_t target) { if (!cur_frame.has_std_frame()) return false; const ::std_frame& cur_std_frame = cur_frame.std_frame(); if (!cur_std_frame.has_operand_post_list()) return false; const operand_value_list& operand_list = cur_std_frame.operand_post_list(); for (int i = 0; i < operand_list.elem_size(); i++) { const ::operand_info& cur_element = operand_list.elem(i); const ::operand_info_specific& cur_specific = cur_element.operand_info_specific(); if (!cur_specific.has_mem_operand()) continue; uint64_t curr = cur_specific.mem_operand().address(); if (curr == target) { std::cout << cur_frame_counter << " " << i << std::endl; return true; } } return false; }
void print_memory_values(frame &cur_frame) { const ::std_frame& cur_std_frame = cur_frame.std_frame(); if(cur_std_frame.has_operand_pre_list()) { //std::cout << " post_list:" << std::endl; print_list(cur_std_frame.operand_pre_list()); } if(cur_std_frame.has_operand_post_list()) { //std::cout << " post_list:" << std::endl; print_list(cur_std_frame.operand_post_list()); } }
bool isAddressOverwritten(frame &cur_frame,uint64_t ele) { const ::std_frame& cur_std_frame = cur_frame.std_frame(); if (cur_std_frame.has_operand_pre_list()) { for(int i = 0; i < cur_std_frame.operand_pre_list().elem_size(); i++){ const ::operand_info_specific& cur_specific = cur_std_frame.operand_pre_list().elem(i).operand_info_specific(); if(cur_specific.has_mem_operand()){ if (ele == cur_specific.mem_operand().address()){ if(cur_std_frame.operand_pre_list().elem(i).operand_usage().written()) return true; } } } } return false; }