-/* Copyright (c) 2015-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/mc/remote/Client.hpp"
+#include "src/internal_config.h"
+#include <simgrid/modelchecker.h>
+
#include <cerrno>
#include <cstdlib>
-
+#include <cstring>
#include <sys/ptrace.h>
#include <sys/socket.h>
#include <sys/types.h>
-#include <xbt/log.h>
-#include <xbt/mmalloc.h>
-#include <xbt/sysdep.h>
-
-#include <simgrid/modelchecker.h>
-
-#include "src/internal_config.h"
-
-#include "src/mc/mc_request.hpp"
-#include "src/mc/remote/Client.hpp"
-#include "src/mc/remote/mc_protocol.h"
-
-#include "src/smpi/include/private.hpp"
-
// We won't need those once the separation MCer/MCed is complete:
#include "src/mc/mc_smx.hpp"
xbt_die("Unexpected socket type %i", type);
XBT_DEBUG("Model-checked application found expected socket type");
- instance_ = std::unique_ptr<Client>(new simgrid::mc::Client(fd));
+ instance_.reset(new simgrid::mc::Client(fd));
// Wait for the model-checker:
errno = 0;
#error "no ptrace equivalent coded for this platform"
#endif
if (errno != 0 || raise(SIGSTOP) != 0)
- xbt_die("Could not wait for the model-checker");
+ xbt_die("Could not wait for the model-checker (errno = %d: %s)", errno, strerror(errno));
instance_->handleMessages();
return instance_.get();
}
-void Client::handleDeadlockCheck(s_mc_message_t* msg)
+void Client::handleDeadlockCheck(s_mc_message_t*)
{
bool deadlock = false;
if (not simix_global->process_list.empty()) {
s_mc_message_int_t answer{MC_MESSAGE_DEADLOCK_CHECK_REPLY, deadlock};
xbt_assert(channel_.send(answer) == 0, "Could not send response");
}
-void Client::handleContinue(s_mc_message_t* msg)
+void Client::handleContinue(s_mc_message_t*)
{
/* Nothing to do */
}
}
}
-void Client::reportAssertionFailure(const char* description)
+void Client::reportAssertionFailure()
{
if (channel_.send(MC_MESSAGE_ASSERTION_FAILED))
xbt_die("Could not send assertion to model-checker");
region.size = size;
region.block = ((char*)stack - (char*)heap->heapbase) / BLOCKSIZE + 1;
#if HAVE_SMPI
- if (smpi_privatize_global_variables == SmpiPrivStrategies::Mmap && process)
- region.process_index = process->pid - 1;
+ if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP && process)
+ region.process_index = process->get_pid() - 1;
else
#endif
region.process_index = -1;