/************************************* Take Snapshot ************************************/
/****************************************************************************************/
-void Snapshot::snapshot_regions(RemoteClient* process)
+void Snapshot::snapshot_regions(RemoteSimulation* process)
{
snapshot_regions_.clear();
else if (not current_variable.location_list.empty()) {
dwarf::Location location = simgrid::dwarf::resolve(current_variable.location_list, current_variable.object_info,
&(stack_frame->unw_cursor), (void*)stack_frame->frame_base,
- &mc_model_checker->process());
+ &mc_model_checker->get_remote_simulation());
if (not location.in_memory())
xbt_die("Cannot handle non-address variable");
static std::vector<s_mc_stack_frame_t> unwind_stack_frames(UnwindContext* stack_context)
{
- const RemoteClient* process = &mc_model_checker->process();
+ const RemoteSimulation* process = &mc_model_checker->get_remote_simulation();
std::vector<s_mc_stack_frame_t> result;
unw_cursor_t c = stack_context->cursor();
// TODO, check condition check (unw_init_local==0 means end of frame)
- while (1) {
+ while (true) {
s_mc_stack_frame_t stack_frame;
stack_frame.unw_cursor = c;
return result;
}
-void Snapshot::snapshot_stacks(RemoteClient* process)
+void Snapshot::snapshot_stacks(RemoteSimulation* process)
{
for (auto const& stack : process->stack_areas()) {
s_mc_snapshot_stack_t st;
static void snapshot_handle_ignore(Snapshot* snapshot)
{
- xbt_assert(snapshot->process());
+ xbt_assert(snapshot->get_remote_simulation());
// Copy the memory:
- for (auto const& region : snapshot->process()->ignored_regions()) {
+ for (auto const& region : snapshot->get_remote_simulation()->ignored_regions()) {
s_mc_snapshot_ignored_data_t ignored_data;
ignored_data.start = (void*)region.addr;
ignored_data.data.resize(region.size);
// TODO, we should do this once per privatization segment:
- snapshot->process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
+ snapshot->get_remote_simulation()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
snapshot->ignored_data_.push_back(std::move(ignored_data));
}
// Zero the memory:
- for (auto const& region : snapshot->process()->ignored_regions())
- snapshot->process()->clear_bytes(remote(region.addr), region.size);
+ for (auto const& region : snapshot->get_remote_simulation()->ignored_regions())
+ snapshot->get_remote_simulation()->clear_bytes(remote(region.addr), region.size);
}
static void snapshot_ignore_restore(const simgrid::mc::Snapshot* snapshot)
{
for (auto const& ignored_data : snapshot->ignored_data_)
- snapshot->process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(), remote(ignored_data.start));
+ snapshot->get_remote_simulation()->write_bytes(ignored_data.data.data(), ignored_data.data.size(),
+ remote(ignored_data.start));
}
-Snapshot::Snapshot(int num_state, RemoteClient* process) : AddressSpace(process), num_state_(num_state)
+Snapshot::Snapshot(int num_state, RemoteSimulation* process) : AddressSpace(process), num_state_(num_state)
{
XBT_DEBUG("Taking snapshot %i", num_state);
else if (type == RegionType::Heap)
xbt_assert(not object_info, "Unexpected object info for heap region.");
- Region* region = new Region(type, start_addr, size);
+ auto* region = new Region(type, start_addr, size);
region->object_info(object_info);
- snapshot_regions_.push_back(std::unique_ptr<Region>(std::move(region)));
+ snapshot_regions_.push_back(std::unique_ptr<Region>(region));
}
void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions options) const
return buffer;
}
} else
- return this->process()->read_bytes(buffer, size, address, options);
+ return this->get_remote_simulation()->read_bytes(buffer, size, address, options);
}
/** @brief Find the snapshotted region from a pointer
*
return get_region(addr);
}
-void Snapshot::restore(RemoteClient* process)
+void Snapshot::restore(RemoteSimulation* process) const
{
XBT_DEBUG("Restore snapshot %i", num_state_);