aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-07-27 08:58:48 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2020-07-27 08:58:48 -0700
commitddce17585c7a87be5432bd4c6a5725e05e88d9dc (patch)
treee90a86281077863da5ce09c32d3addb12caba3d9
parenta4089f524fbcf176f3d4aae43a35e3c6effcc854 (diff)
downloadgdb-ddce17585c7a87be5432bd4c6a5725e05e88d9dc.zip
gdb-ddce17585c7a87be5432bd4c6a5725e05e88d9dc.tar.gz
gdb-ddce17585c7a87be5432bd4c6a5725e05e88d9dc.tar.bz2
Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later.
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/fbsd-nat.h12
2 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc6e6e5..fc2d0b1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index b5a62b9..1b1e043 100644
--- a/gdb/fbsd-nat.h
+++ b/gdb/fbsd-nat.h
@@ -21,11 +21,17 @@
#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