X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fd9d52c0c7a9c96221fff2013cdeef05b6e979e2..6a67ff3523fc9af2c5d0316c8fec2e7375230787:/src/mc/Client.cpp diff --git a/src/mc/Client.cpp b/src/mc/Client.cpp index cf7398d255..e712affd25 100644 --- a/src/mc/Client.cpp +++ b/src/mc/Client.cpp @@ -67,7 +67,15 @@ Client* Client::initialize() client_ = std::unique_ptr(new simgrid::mc::Client(fd)); // Wait for the model-checker: - if (ptrace(PTRACE_TRACEME, 0, nullptr, nullptr) == -1 || raise(SIGSTOP) != 0) + errno = 0; +#if defined __linux__ + ptrace(PTRACE_TRACEME, 0, nullptr, nullptr); +#elif defined BSD + ptrace(PT_TRACE_ME, 0, nullptr, 0); +#else +# error "no ptrace equivalent coded for this platform" +#endif + if(errno != 0 || raise(SIGSTOP) != 0) xbt_die("Could not wait for the model-checker"); client_->handleMessages(); @@ -95,7 +103,7 @@ void Client::handleMessages() { // Check deadlock: bool deadlock = false; - smx_process_t process; + smx_actor_t process; if (xbt_swag_size(simix_global->process_list)) { deadlock = true; xbt_swag_foreach(process, simix_global->process_list) @@ -123,7 +131,7 @@ void Client::handleMessages() if (s != sizeof(message)) xbt_die("Unexpected size for SIMCALL_HANDLE"); memcpy(&message, message_buffer, sizeof(message)); - smx_process_t process = SIMIX_process_from_PID(message.pid); + smx_actor_t process = SIMIX_process_from_PID(message.pid); if (!process) xbt_die("Invalid pid %lu", (unsigned long) message.pid); SIMIX_simcall_handle(&process->simcall, message.value); @@ -138,7 +146,9 @@ void Client::handleMessages() if (s != sizeof(message)) xbt_die("Unexpected size for SIMCALL_HANDLE"); memcpy(&message, message_buffer, sizeof(message)); +#if HAVE_SMPI smpi_really_switch_data_segment(message.index); +#endif } break; @@ -226,7 +236,7 @@ void Client::declareSymbol(const char *name, int* value) xbt_die("Could send REGISTER_SYMBOL message to model-checker"); } -void Client::declareStack(void *stack, size_t size, smx_process_t process, ucontext_t* context) +void Client::declareStack(void *stack, size_t size, smx_actor_t process, ucontext_t* context) { xbt_mheap_t heap = mmalloc_get_current_heap();