* @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) {
if (region->storage_type == MC_REGION_STORAGE_TYPE_PRIVATIZED) {
#ifdef HAVE_SMPI
// Use the current process index of the snapshot:
- if (process_index == MC_PROCESS_INDEX_DISABLED) {
+ if (process_index == simgrid::mc::ProcessIndexDisabled) {
process_index = snapshot->privatization_index;
}
if (process_index < 0) {
}
const void* Snapshot::read_bytes(void* buffer, std::size_t size,
- std::uint64_t address, int process_index,
- AddressSpace::ReadMode mode)
+ remote_ptr<void> 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 {
}
}
else
- return MC_process_read(this->process, mode, buffer, (void*)address, size, process_index);
+ return this->read_bytes(buffer, size, address, process_index, mode);
}
}