summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fb2e345)
No PTRACE_O_TRACEEXIT equivalent in the original ptrace API, futher
work will indicate if this will be a problem.
Update message a bit when neither linux's or BSD's version are
available.
#elif defined BSD
ptrace(PT_TRACE_ME, 0, nullptr, 0);
#else
#elif defined BSD
ptrace(PT_TRACE_ME, 0, nullptr, 0);
#else
-# error "ptrace not declared on this platform"
+# error "no ptrace equivalent coded for this platform"
#endif
if(errno != 0 || raise(SIGSTOP) != 0)
xbt_die("Could not wait for the model-checker");
#endif
if(errno != 0 || raise(SIGSTOP) != 0)
xbt_die("Could not wait for the model-checker");
ptrace(PTRACE_SETOPTIONS, pid, nullptr, PTRACE_O_TRACEEXIT);
ptrace(PTRACE_CONT, pid, 0, 0);
ptrace(PTRACE_SETOPTIONS, pid, nullptr, PTRACE_O_TRACEEXIT);
ptrace(PTRACE_CONT, pid, 0, 0);
+#elif defined BSD
+ ptrace(PT_CONTINUE, pid, (caddr_t)1, 0);
+#else
+# error "no ptrace equivalent coded for this platform"
+#endif
}
static const std::pair<const char*, const char*> ignored_local_variables[] = {
}
static const std::pair<const char*, const char*> ignored_local_variables[] = {
if (pid == this->process().pid()) {
// From PTRACE_O_TRACEEXIT:
if (pid == this->process().pid()) {
// From PTRACE_O_TRACEEXIT:
if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
if (ptrace(PTRACE_GETEVENTMSG, this->process().pid(), 0, &status) == -1)
xbt_die("Could not get exit status");
if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
if (ptrace(PTRACE_GETEVENTMSG, this->process().pid(), 0, &status) == -1)
xbt_die("Could not get exit status");
mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
}
}
mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
}
}
// We don't care about signals, just reinject them:
if (WIFSTOPPED(status)) {
XBT_DEBUG("Stopped with signal %i", (int) WSTOPSIG(status));
// We don't care about signals, just reinject them:
if (WIFSTOPPED(status)) {
XBT_DEBUG("Stopped with signal %i", (int) WSTOPSIG(status));
- if (ptrace(PTRACE_CONT, this->process().pid(), 0, WSTOPSIG(status)) == -1)
+ errno = 0;
+#ifdef __linux__
+ ptrace(PTRACE_CONT, this->process().pid(), 0, WSTOPSIG(status));
+#elif defined BSD
+ ptrace(PT_CONTINUE, this->process().pid(), nullptr, WSTOPSIG(status));
+#endif
+ if (errno != 0)
xbt_die("Could not PTRACE_CONT");
}
xbt_die("Could not PTRACE_CONT");
}