X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8173f52406580284c8ec5feab41784a8f4aed8ce..eb417d0c8064e83fc1211abc819ae93687505003:/src/mc/mc_snapshot.cpp diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index 857d47d38f..270a6aedcb 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -23,7 +23,8 @@ extern "C" { * @param Snapshot region in the snapshot this pointer belongs to * (or NULL if it does not belong to any snapshot region) * */ -mc_mem_region_t mc_get_snapshot_region(const void* addr, mc_snapshot_t snapshot, int process_index) +mc_mem_region_t mc_get_snapshot_region( + const void* addr, const s_mc_snapshot_t* snapshot, int process_index) { size_t n = snapshot->snapshot_regions_count; for (size_t i = 0; i != n; ++i) { @@ -183,12 +184,12 @@ Snapshot::~Snapshot() } const void* Snapshot::read_bytes(void* buffer, std::size_t size, - std::uint64_t address, int process_index, - AddressSpace::ReadMode mode) + remote_ptr address, int process_index, + AddressSpace::ReadMode mode) const { - mc_mem_region_t region = mc_get_snapshot_region((void*)address, this, process_index); + mc_mem_region_t region = mc_get_snapshot_region((void*)address.address(), this, process_index); if (region) { - const void* res = MC_region_read(region, buffer, (void*)address, size); + const void* res = MC_region_read(region, buffer, (void*)address.address(), size); if (buffer == res || mode == AddressSpace::Lazy) return res; else { @@ -197,7 +198,7 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size, } } else - return MC_process_read(this->process, mode, buffer, (void*)address, size, process_index); + return this->read_bytes(buffer, size, address, process_index, mode); } }