X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5c12b10224870f6f78c90ae7d5747cd93a60f458..4bcfd40036f842e976d329cd0cee7349b8e0f4d6:/src/mc/sosp/mc_snapshot.hpp?ds=sidebyside diff --git a/src/mc/sosp/mc_snapshot.hpp b/src/mc/sosp/mc_snapshot.hpp index b02b4d6002..35d07cbb36 100644 --- a/src/mc/sosp/mc_snapshot.hpp +++ b/src/mc/sosp/mc_snapshot.hpp @@ -7,7 +7,7 @@ #define SIMGRID_MC_SNAPSHOT_HPP #include "src/mc/ModelChecker.hpp" -#include "src/mc/mc_unw.hpp" +#include "src/mc/inspect/mc_unw.hpp" #include "src/mc/remote/RemoteClient.hpp" #include "src/mc/sosp/RegionSnapshot.hpp" @@ -43,9 +43,6 @@ static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, simgr } } -XBT_PRIVATE simgrid::mc::RegionSnapshot* mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot, - int process_index); - // ***** MC Snapshot /** Ignored data @@ -96,34 +93,32 @@ class XBT_PRIVATE Snapshot final : public AddressSpace { public: Snapshot(RemoteClient* process, int num_state); ~Snapshot() = default; + + /* Initialization */ + void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, void* permanent_addr, + std::size_t size); + + /* Regular use */ const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index = ProcessIndexAny, ReadOptions options = ReadOptions::none()) const override; + RegionSnapshot* get_region(const void* addr, int process_index) const; + RegionSnapshot* get_region(const void* addr, int process_index, RegionSnapshot* hinted_region) const; // To be private - int num_state; - std::size_t heap_bytes_used; - std::vector> snapshot_regions; - std::set enabled_processes; - int privatization_index; - std::vector stack_sizes; - std::vector stacks; - std::vector to_ignore; - std::uint64_t hash; - std::vector ignored_data; + int num_state_; + std::size_t heap_bytes_used_; + std::vector> snapshot_regions_; + std::set enabled_processes_; + int privatization_index_; + std::vector stack_sizes_; + std::vector stacks_; + std::vector to_ignore_; + std::uint64_t hash_ = 0; + std::vector ignored_data_; }; } // namespace mc } // namespace simgrid -static XBT_ALWAYS_INLINE simgrid::mc::RegionSnapshot* mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot, - int process_index, - simgrid::mc::RegionSnapshot* region) -{ - if (region->contain(simgrid::mc::remote(addr))) - return region; - else - return mc_get_snapshot_region(addr, snapshot, process_index); -} - static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot); namespace simgrid { @@ -171,7 +166,7 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(simgrid::mc::RegionSnapshot* case simgrid::mc::StorageType::Chunked: { // Last byte of the region: void* end = (char*)addr + size - 1; - if (simgrid::mc::mmu::sameChunk((std::uintptr_t)addr, (std::uintptr_t)end)) { + if (simgrid::mc::mmu::same_chunk((std::uintptr_t)addr, (std::uintptr_t)end)) { // The memory is contained in a single page: return mc_translate_address_region_chunked((uintptr_t)addr, region); }