]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Assume FreeBSD kernels always report exec events.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 16 Sep 2020 18:40:05 +0000 (11:40 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 16 Sep 2020 18:40:05 +0000 (11:40 -0700)
FreeBSD kernels have reported exec events via the PL_FLAG_EXEC flag
since 8.2 release.  The most recent release that did not support this
flag is 7.4 released in November of 2011.

Note that the FreeBSD native target already assumed that PL_FLAG_SCE
and PL_FLAG_SCX were always supported on systems supporting
PT_LWPINFO, but those flags were added at the same time as
PL_FLAG_EXEC.  Building the native target on a system without
PL_FLAG_EXEC would have failed to build before this change already as
a result.

gdb/ChangeLog:

* fbsd-nat.c (fbsd_nat_target::wait): Always check for
PL_FLAG_EXEC.
(fbsd_nat_target::insert_exec_catchpoint)
(fbsd_nat_target::remove_exec_catchpoint): Always define.
* fbsd-nat.h (fbsd_nat_target::insert_exec_catchpoint)
(fbsd_nat_target::remove_exec_catchpoint): Always declare.

gdb/ChangeLog
gdb/fbsd-nat.c
gdb/fbsd-nat.h

index 7159398dfc7fd26995cbea5189938b3a73e0e427..d05e6d21f857132f99970cb538dd1956fca91544 100644 (file)
@@ -1,3 +1,12 @@
+2020-09-16  John Baldwin  <jhb@FreeBSD.org>
+
+       * fbsd-nat.c (fbsd_nat_target::wait): Always check for
+       PL_FLAG_EXEC.
+       (fbsd_nat_target::insert_exec_catchpoint)
+       (fbsd_nat_target::remove_exec_catchpoint): Always define.
+       * fbsd-nat.h (fbsd_nat_target::insert_exec_catchpoint)
+       (fbsd_nat_target::remove_exec_catchpoint): Always declare.
+
 2020-09-16  John Baldwin  <jhb@FreeBSD.org>
 
        * configure.ac: Remove check for kinfo_getvmmap().
index ac88fbc87f7d5228bafab51cad69d20ce5674526..0ab7f83d682782d05d9cbde91412dff848a64576 100644 (file)
@@ -1335,7 +1335,6 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 #endif
 #endif
 
-#ifdef PL_FLAG_EXEC
          if (pl.pl_flags & PL_FLAG_EXEC)
            {
              ourstatus->kind = TARGET_WAITKIND_EXECD;
@@ -1343,7 +1342,6 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
                = xstrdup (pid_to_exec_file (pid));
              return wptid;
            }
-#endif
 
 #ifdef USE_SIGTRAP_SIGINFO
          if (fbsd_handle_debug_trap (this, wptid, pl))
@@ -1508,9 +1506,7 @@ fbsd_nat_target::post_attach (int pid)
   fbsd_add_threads (this, pid);
 }
 
-#ifdef PL_FLAG_EXEC
-/* If the FreeBSD kernel supports PL_FLAG_EXEC, then traced processes
-   will always stop after exec.  */
+/* Traced processes always stop after exec.  */
 
 int
 fbsd_nat_target::insert_exec_catchpoint (int pid)
@@ -1523,7 +1519,6 @@ fbsd_nat_target::remove_exec_catchpoint (int pid)
 {
   return 0;
 }
-#endif
 
 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
 int
index ed3c1cdfc51db5bdb98afeb7992ddf47f67ff27e..e8b7930ce95969ce5764f14de56afdbe278908c6 100644 (file)
@@ -89,10 +89,8 @@ public:
   int remove_vfork_catchpoint (int) override;
 #endif
 
-#ifdef PL_FLAG_EXEC
   int insert_exec_catchpoint (int) override;
   int remove_exec_catchpoint (int) override;
-#endif
 
 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
   int set_syscall_catchpoint (int, bool, int, gdb::array_view<const int>)