public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later.
@ 2020-07-22 20:01 John Baldwin
  2020-07-24 20:06 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: John Baldwin @ 2020-07-22 20:01 UTC (permalink / raw)
  To: gdb-patches

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  |  5 +++++
 gdb/fbsd-nat.h | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1cef37dea6..94b952ddf9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-22  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-22  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* python/py-registers.c (gdbpy_register_object_data_init): Remove
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index b5a62b9212..1b1e043dae 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
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later.
  2020-07-22 20:01 [PATCH] Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later John Baldwin
@ 2020-07-24 20:06 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2020-07-24 20:06 UTC (permalink / raw)
  To: John Baldwin; +Cc: gdb-patches

>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

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

Looks fine to me.  Thank you.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-24 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 20:01 [PATCH] Use SIGTRAP si_code values for all FreeBSD architectures on 11.3 and later John Baldwin
2020-07-24 20:06 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).