+2015-04-27 John Baldwin <jhb@FreeBSD.org>
+
+ * fbsd-nat.c: (fbsd_wait) [PL_FLAG_EXEC]: Report TARGET_WAITKIND_EXECD
+ event if PL_FLAG_EXEC is set.
+ [PL_FLAG_EXEC] (fbsd_insert_exec_catchpoint): New function.
+ [PL_FLAG_EXEC] (fbsd_remove_exec_catchpoint): New function.
+ (fbsd_nat_add_target) [PL_FLAG_EXEC]: Set
+ "to_insert_exec_catchpoint" to "fbsd_insert_exec_catchpoint".
+ Set "to_remove_exec_catchpoint" to "fbsd_remove_exec_catchpoint".
+
2015-04-27 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c: [PT_LWPINFO] New variable super_wait.
continue;
}
#endif
+
+#ifdef PL_FLAG_EXEC
+ if (pl.pl_flags & PL_FLAG_EXEC)
+ {
+ ourstatus->kind = TARGET_WAITKIND_EXECD;
+ ourstatus->value.execd_pathname
+ = xstrdup (fbsd_pid_to_exec_file (NULL, pid));
+ return wptid;
+ }
+#endif
}
return wptid;
}
fbsd_enable_follow_fork (pid);
}
#endif
+
+#ifdef PL_FLAG_EXEC
+/* If the FreeBSD kernel supports PL_FLAG_EXEC, then traced processes
+ will always stop after exec. */
+
+static int
+fbsd_insert_exec_catchpoint (struct target_ops *self, int pid)
+{
+ return 0;
+}
+
+static int
+fbsd_remove_exec_catchpoint (struct target_ops *self, int pid)
+{
+ return 0;
+}
+#endif
#endif
void
t->to_post_startup_inferior = fbsd_post_startup_inferior;
t->to_post_attach = fbsd_post_attach;
#endif
+#ifdef PL_FLAG_EXEC
+ t->to_insert_exec_catchpoint = fbsd_insert_exec_catchpoint;
+ t->to_remove_exec_catchpoint = fbsd_remove_exec_catchpoint;
+#endif
#endif
add_target (t);
}