#include "src/mc/mc_unw.h"
#include "src/mc/mc_snapshot.h"
#include "src/mc/mc_ignore.h"
#include "src/mc/mc_unw.h"
#include "src/mc/mc_snapshot.h"
#include "src/mc/mc_ignore.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_process, mc,
"MC process information");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_process, mc,
"MC process information");
{
const char* map_basename = xbt_basename((char*) pathname);
regmatch_t match;
if(regexec(&res->so_re, map_basename, 1, &match, 0))
{
const char* map_basename = xbt_basename((char*) pathname);
regmatch_t match;
if(regexec(&res->so_re, map_basename, 1, &match, 0))
{
int fd = open("/dev/zero", O_RDONLY);
if (fd<0)
xbt_die("Could not open /dev/zero");
{
int fd = open("/dev/zero", O_RDONLY);
if (fd<0)
xbt_die("Could not open /dev/zero");
- zero_buffer = mmap(NULL, zero_buffer_size, PROT_READ, MAP_SHARED, fd, 0);
+ zero_buffer = mmap(nullptr, zero_buffer_size, PROT_READ, MAP_SHARED, fd, 0);
int open_vm(pid_t pid, int flags)
{
const size_t buffer_size = 30;
int open_vm(pid_t pid, int flags)
{
const size_t buffer_size = 30;
Process::Process(pid_t pid, int sockfd) :
AddressSpace(this),pid_(pid), socket_(sockfd), running_(true)
{}
Process::Process(pid_t pid, int sockfd) :
AddressSpace(this),pid_(pid), socket_(sockfd), running_(true)
{}
remote(std_heap_var->address),
simgrid::mc::ProcessIndexDisabled);
remote(std_heap_var->address),
simgrid::mc::ProcessIndexDisabled);
this->unw_addr_space = unw_create_addr_space(&mc_unw_accessors , __BYTE_ORDER);
this->unw_underlying_addr_space = unw_create_addr_space(&mc_unw_vmread_accessors, __BYTE_ORDER);
this->unw_underlying_context = _UPT_create(this->pid_);
this->unw_addr_space = unw_create_addr_space(&mc_unw_accessors , __BYTE_ORDER);
this->unw_underlying_addr_space = unw_create_addr_space(&mc_unw_vmread_accessors, __BYTE_ORDER);
this->unw_underlying_context = _UPT_create(this->pid_);
if (this->unw_underlying_addr_space != unw_local_addr_space) {
unw_destroy_addr_space(this->unw_underlying_addr_space);
_UPT_destroy(this->unw_underlying_context);
}
if (this->unw_underlying_addr_space != unw_local_addr_space) {
unw_destroy_addr_space(this->unw_underlying_addr_space);
_UPT_destroy(this->unw_underlying_context);
}
this->maestro_stack_start_ = nullptr;
this->maestro_stack_end_ = nullptr;
this->object_infos.resize(0);
this->maestro_stack_start_ = nullptr;
this->maestro_stack_end_ = nullptr;
this->object_infos.resize(0);
this->maestro_stack_start_ = remote(reg.start_addr);
this->maestro_stack_end_ = remote(reg.end_addr);
}
this->maestro_stack_start_ = remote(reg.start_addr);
this->maestro_stack_end_ = remote(reg.end_addr);
}
// Resolve time (including accross differents objects):
for (auto const& object_info : this->object_infos)
// Resolve time (including accross differents objects):
for (auto const& object_info : this->object_infos)
xbt_assert(this->maestro_stack_start_, "Did not find maestro_stack_start");
xbt_assert(this->maestro_stack_end_, "Did not find maestro_stack_end");
xbt_assert(this->maestro_stack_start_, "Did not find maestro_stack_start");
xbt_assert(this->maestro_stack_end_, "Did not find maestro_stack_end");
{
std::shared_ptr<simgrid::mc::ObjectInformation> info = this->find_object_info_exec(ip);
return info ? info->find_function((void*) ip.address()) : nullptr;
{
std::shared_ptr<simgrid::mc::ObjectInformation> info = this->find_object_info_exec(ip);
return info ? info->find_function((void*) ip.address()) : nullptr;
ReadOptions options) const
{
if (process_index != simgrid::mc::ProcessIndexDisabled) {
std::shared_ptr<simgrid::mc::ObjectInformation> const& info =
this->find_object_info_rw((void*)address.address());
// Segment overlap is not handled.
ReadOptions options) const
{
if (process_index != simgrid::mc::ProcessIndexDisabled) {
std::shared_ptr<simgrid::mc::ObjectInformation> const& info =
this->find_object_info_rw((void*)address.address());
// Segment overlap is not handled.
{
if (pwrite_whole(this->memory_file, buffer, len, address.address()) < 0)
xbt_die("Write to process %lli failed", (long long) this->pid_);
}
{
if (pwrite_whole(this->memory_file, buffer, len, address.address()) < 0)
xbt_die("Write to process %lli failed", (long long) this->pid_);
}
while (len) {
size_t s = len > zero_buffer_size ? zero_buffer_size : len;
this->write_bytes(zero_buffer, s, address);
while (len) {
size_t s = len > zero_buffer_size ? zero_buffer_size : len;
this->write_bytes(zero_buffer, s, address);
+std::vector<simgrid::mc::SimixProcessInformation>& Process::simix_processes()
+{
+ xbt_assert(mc_mode != MC_MODE_CLIENT);
+ MC_process_smx_refresh(&mc_model_checker->process());
+ return smx_process_infos;
+}
+