#include <mc/mc.h>
#include "mc_snapshot.h"
-#include "mc_dwarf.hpp"
+#include "mc_object_info.h"
#include "mc_mmu.h"
#include "mc_unw.h"
#include "mc_protocol.h"
void MC_find_object_address(
std::vector<simgrid::mc::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
{
- const char* file_name = xbt_strdup(result->file_name.c_str());
+ char* file_name = xbt_strdup(result->file_name.c_str());
const char *name = basename(file_name);
for (size_t i = 0; i < maps.size(); ++i) {
simgrid::mc::VmMap const& reg = maps[i];
xbt_assert(result->start_rw);
xbt_assert(result->start_exec);
+ free(file_name);
}
/************************************* Take Snapshot ************************************/
static void MC_snapshot_handle_ignore(mc_snapshot_t snapshot)
{
- xbt_assert(snapshot->process);
+ xbt_assert(snapshot->process());
// Copy the memory:
for (auto const& region : mc_model_checker->process().ignored_regions()) {
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(
+ snapshot->process()->read_bytes(
ignored_data.data.data(), region.size, remote(region.addr),
simgrid::mc::ProcessIndexDisabled);
snapshot->ignored_data.push_back(std::move(ignored_data));
// Zero the memory:
for(auto const& region : mc_model_checker->process().ignored_regions()) {
- snapshot->process->clear_bytes(remote(region.addr), region.size);
+ snapshot->process()->clear_bytes(remote(region.addr), region.size);
}
}
static void MC_snapshot_ignore_restore(mc_snapshot_t snapshot)
{
for (auto const& ignored_data : snapshot->ignored_data)
- snapshot->process->write_bytes(
+ snapshot->process()->write_bytes(
ignored_data.data.data(), ignored_data.data.size(),
remote(ignored_data.start));
}
simgrid::mc::Process* mc_process = &mc_model_checker->process();
- mc_snapshot_t snapshot = new simgrid::mc::Snapshot();
+ mc_snapshot_t snapshot = new simgrid::mc::Snapshot(mc_process);
- snapshot->process = mc_process;
snapshot->num_state = num_state;
smx_process_t process;
if (_sg_mc_visited > 0 || strcmp(_sg_mc_property_file, "")) {
snapshot->stacks =
MC_take_snapshot_stacks(&snapshot);
- if (_sg_mc_hash && !snapshot->stacks.empty()) {
+ if (_sg_mc_hash) {
snapshot->hash = simgrid::mc::hash(*snapshot);
} else {
snapshot->hash = 0;