void handle_events(int fd, short events);
void wait_for_requests();
void handle_simcall(Transition const& transition);
+
XBT_ATTRIB_NORETURN void exit(int status);
bool checkDeadlock();
}
}
+bool Session::actor_is_enabled(aid_t pid)
+{
+ s_mc_message_actor_enabled_t msg{MC_MESSAGE_ACTOR_ENABLED, pid};
+ model_checker_->process().get_channel().send(msg);
+ char buff[MC_MESSAGE_LENGTH];
+ ssize_t received = model_checker_->process().get_channel().receive(buff, MC_MESSAGE_LENGTH, true);
+ xbt_assert(received == sizeof(s_mc_message_int_t), "Unexpected size in answer to ACTOR_ENABLED");
+ return ((s_mc_message_int_t*)buff)->value;
+}
+
simgrid::mc::Session* session;
}
#ifndef SIMGRID_MC_SESSION_HPP
#define SIMGRID_MC_SESSION_HPP
+#include "simgrid/forward.h"
#include "src/mc/ModelChecker.hpp"
#include <functional>
void log_state();
void restore_initial_state();
+ bool actor_is_enabled(aid_t pid);
};
// Temporary :)
#if SIMGRID_HAVE_MC
#include "src/mc/ModelChecker.hpp"
+#include "src/mc/Session.hpp"
#include "src/mc/remote/RemoteClient.hpp"
using simgrid::mc::remote;
#if SIMGRID_HAVE_MC
// If in the MCer, ask the client app since it has all the data
if (mc_model_checker != nullptr) {
- return mc_model_checker->process().actor_is_enabled(actor->get_pid());
+ return simgrid::mc::session->actor_is_enabled(actor->get_pid());
}
#endif
#include <signal.h>
#include <sys/wait.h>
-simgrid::mc::CheckerSide::~CheckerSide()
+namespace simgrid {
+namespace mc {
+
+CheckerSide::~CheckerSide()
{
if (socket_event_ != nullptr)
event_free(socket_event_);
event_base_free(base_);
}
-void simgrid::mc::CheckerSide::start(int socket, void (*handler)(int, short, void*))
+void CheckerSide::start(int socket, void (*handler)(int, short, void*))
{
base_ = event_base_new();
event_add(signal_event_, NULL);
}
-void simgrid::mc::CheckerSide::dispatch()
+void CheckerSide::dispatch()
{
event_base_dispatch(base_);
}
-void simgrid::mc::CheckerSide::break_loop()
+void CheckerSide::break_loop()
{
event_base_loopbreak(base_);
}
+
+} // namespace mc
+} // namespace simgrid
_UPT_destroy(context);
unw_destroy_addr_space(as);
}
-
-bool RemoteClient::actor_is_enabled(aid_t pid)
-{
- s_mc_message_actor_enabled_t msg{MC_MESSAGE_ACTOR_ENABLED, pid};
- process()->get_channel().send(msg);
- char buff[MC_MESSAGE_LENGTH];
- ssize_t received = process()->get_channel().receive(buff, MC_MESSAGE_LENGTH, true);
- xbt_assert(received == sizeof(s_mc_message_int_t), "Unexpected size in answer to ACTOR_ENABLED");
- return ((s_mc_message_int_t*)buff)->value;
-}
}
}
/** The corresponding context
*/
void* unw_underlying_context;
-
- /* Check whether the given actor is enabled */
- bool actor_is_enabled(aid_t pid);
};
/** Open a FD to a remote process memory (`/dev/$pid/mem`)