}
/* Init heap information used in heap comparison algorithm */
- xbt_mheap_t heap1 = (xbt_mheap_t)s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
- remote(process.heap_address), simgrid::mc::ReadOptions::lazy());
- xbt_mheap_t heap2 = (xbt_mheap_t)s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
- remote(process.heap_address), simgrid::mc::ReadOptions::lazy());
+ xbt_mheap_t heap1 =
+ static_cast<xbt_mheap_t>(s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+ remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
+ xbt_mheap_t heap2 =
+ static_cast<xbt_mheap_t>(s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+ remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
if (state_comparator.initHeapInformation(heap1, heap2, &s1->to_ignore_, &s2->to_ignore_) == -1) {
XBT_VERB("(%d - %d) Different heap information", s1->num_state_, s2->num_state_);
return false;
}
}
-const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
- ReadOptions /*options*/) const
+void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions /*options*/) const
{
if (pread_whole(this->memory_file, buffer, size, (size_t)address.address()) < 0)
xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
RemoteClient& operator=(RemoteClient&&) = delete;
// Read memory:
- const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
- ReadOptions options = ReadOptions::none()) const override;
+ void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+ ReadOptions options = ReadOptions::none()) const override;
void read_variable(const char* name, void* target, size_t size) const;
template <class T> void read_variable(const char* name, T* target) const
return (char*)snapshot_page + offset;
}
-const void* Region::read(void* target, const void* addr, std::size_t size)
+void* Region::read(void* target, const void* addr, std::size_t size)
{
xbt_assert(contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
* @param size Size of the data to read in bytes
* @return Pointer where the data is located (either target buffer or original location)
*/
- const void* read(void* target, const void* addr, std::size_t size);
+ void* read(void* target, const void* addr, std::size_t size);
};
} // namespace mc
snapshot_regions_.push_back(std::unique_ptr<simgrid::mc::Region>(std::move(region)));
}
-const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions options) const
+void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions options) const
{
Region* region = this->get_region((void*)address.address());
if (region) {
- const void* res = region->read(buffer, (void*)address.address(), size);
+ void* res = region->read(buffer, (void*)address.address(), size);
if (buffer == res || options & ReadOptions::lazy())
return res;
else {
/* Initialization */
/* Regular use */
- const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
- ReadOptions options = ReadOptions::none()) const override;
+ void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+ ReadOptions options = ReadOptions::none()) const override;
Region* get_region(const void* addr) const;
Region* get_region(const void* addr, Region* hinted_region) const;
void restore(RemoteClient* process);