]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 27 Jul 2020 15:58:48 +0000 (08:58 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 27 Jul 2020 15:58:48 +0000 (08:58 -0700)
Fixes to set correct si_code values (such as TRAP_BRKPT) were made to
the remaining FreeBSD architectures (MIPS and sparc64) in the head
branch leading up to 12.0 and were merged back between the 11.2 and
11.3 releases.

gdb/ChangeLog:

* fbsd-nat.h: Include <osreldate.h>.  Define USE_SIGTRAP_SIGINFO
for all architectures on FreeBSD 11.3 and later.

gdb/ChangeLog
gdb/fbsd-nat.h

index bc6e6e5af216c537b397c97701c741427ef0488c..fc2d0b130c5755c4950da208640d1a5cc42858da 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-27  John Baldwin  <jhb@FreeBSD.org>
+
+       * fbsd-nat.h: Include <osreldate.h>.  Define USE_SIGTRAP_SIGINFO
+       for all architectures on FreeBSD 11.3 and later.
+
 2020-07-27  Tom Tromey  <tromey@adacore.com>
 
        * gcore.h (load_corefile): Don't declare.
index b5a62b9212e421a6314f12be9fccd0a3caa5a5e6..1b1e043dae72abb80563098ab1695f5a59d1e5cd 100644 (file)
 #define FBSD_NAT_H
 
 #include "inf-ptrace.h"
+#include <osreldate.h>
 #include <sys/proc.h>
 
-#ifdef TRAP_BRKPT
-/* MIPS does not set si_code for SIGTRAP.  sparc64 reports
-   non-standard values in si_code for SIGTRAP.  */
+/* FreeBSD kernels 11.3 and later report valid si_code values for
+   SIGTRAP on all architectures.  Older FreeBSD kernels that supported
+   TRAP_BRKPT did not report valid values for MIPS and sparc64.  Even
+   older kernels without TRAP_BRKPT support did not report valid
+   values on any architecture.  */
+#if (__FreeBSD_kernel_version >= 1102502) || (__FreeBSD_version >= 1102502)
+# define USE_SIGTRAP_SIGINFO
+#elif defined(TRAP_BRKPT)
 # if !defined(__mips__) && !defined(__sparc64__)
 #  define USE_SIGTRAP_SIGINFO
 # endif