flightrec_status add_oneshot_range(size_t addr_start, size_t addr_end) { MemInterval r(addr_start, addr_end); flightrec_status ret = FDR_OK; std::pair<MemIntervalSet::iterator, bool> rv = temp.insert(MemInterval(addr_start, addr_end)); if(!rv.second) { /* overlaps with already existing temporary range; bounce it */ ret = FDR_OVERLAP; } return ret; }
flightrec_status add_monitored_range(size_t addr_start, size_t addr_end) { pthread_mutex_lock(&mutex); std::pair<MemIntervalSet::iterator, bool> rv = persistent.insert(MemInterval(addr_start, addr_end)); if(rv.second) { write_record_type(fd, RTYPE_ADD_UPDATED_RANGE); write(fd, &addr_start, sizeof(size_t)); write(fd, &addr_end, sizeof(size_t)); } pthread_mutex_unlock(&mutex); return rv.second ? FDR_OK : FDR_OVERLAP; }