#include "src/mc/sosp/RemoteProcessMemory.hpp"
+#include "src/mc/explo/Exploration.hpp"
+#include "src/mc/explo/LivenessChecker.hpp"
#include "src/mc/sosp/Snapshot.hpp"
#include "xbt/file.hpp"
#include "xbt/log.h"
+#include "xbt/system_error.hpp"
#include <fcntl.h>
#include <libunwind-ptrace.h>
// ***** RemoteProcessMemory
-RemoteProcessMemory::RemoteProcessMemory(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
-
-void RemoteProcessMemory::init(xbt_mheap_t mmalloc_default_mdp)
+RemoteProcessMemory::RemoteProcessMemory(pid_t pid, xbt_mheap_t mmalloc_default_mdp) : AddressSpace(this), pid_(pid)
{
this->heap_address = remote(mmalloc_default_mdp);
this->unw_addr_space = simgrid::mc::UnwindContext::createUnwindAddressSpace();
this->unw_underlying_addr_space = simgrid::unw::create_addr_space();
this->unw_underlying_context = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
+
+ auto ignored_local_variables = {
+ std::make_pair("e", "*"),
+ std::make_pair("_log_ev", "*"),
+
+ /* Ignore local variable about time used for tracing */
+ std::make_pair("start_time", "*"),
+ };
+ for (auto const& [var, frame] : ignored_local_variables)
+ ignore_local_variable(var, frame);
+
+ ignore_global_variable("counter"); // Static variable used for tracing
}
RemoteProcessMemory::~RemoteProcessMemory()
ignored_regions_.insert(pos, region);
}
+void RemoteProcessMemory::unignore_region(std::uint64_t addr, std::size_t size)
+{
+ IgnoredRegion region;
+ region.addr = addr;
+ region.size = size;
+
+ auto pos = std::lower_bound(ignored_regions_.begin(), ignored_regions_.end(), region,
+ [](auto const& reg1, auto const& reg2) {
+ return reg1.addr < reg2.addr || (reg1.addr == reg2.addr && reg1.size < reg2.size);
+ });
+ if (pos != ignored_regions_.end())
+ ignored_regions_.erase(pos);
+}
+
void RemoteProcessMemory::ignore_heap(IgnoredHeapRegion const& region)
{
// Binary search the position of insertion:
_UPT_destroy(context);
unw_destroy_addr_space(as);
}
+
} // namespace simgrid::mc