aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/fbsd-nat.c12
2 files changed, 15 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index db7a745..4fcd2eb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-12-21 John Baldwin <jhb@FreeBSD.org>
+
+ * fbsd-nat.c (fbsd_handle_debug_trap): Require pl.pl_flags to
+ equal PL_FLAG_SI.
+ (fbsd_nat_target::stopped_by_sw_breakpoint): Likewise.
+
2018-12-21 Paul Marechal <paul.marechal@ericsson.com>
PR gdb/23974
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 6ec273b..e6b6894 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -1238,8 +1238,14 @@ fbsd_handle_debug_trap (ptid_t ptid, const struct ptrace_lwpinfo &pl)
{
/* Ignore traps without valid siginfo or for signals other than
- SIGTRAP. */
- if (! (pl.pl_flags & PL_FLAG_SI) || pl.pl_siginfo.si_signo != SIGTRAP)
+ SIGTRAP.
+
+ FreeBSD kernels prior to r341800 can return stale siginfo for at
+ least some events, but those events can be identified by
+ additional flags set in pl_flags. True breakpoint and
+ single-step traps should not have other flags set in
+ pl_flags. */
+ if (pl.pl_flags != PL_FLAG_SI || pl.pl_siginfo.si_signo != SIGTRAP)
return false;
/* Trace traps are either a single step or a hardware watchpoint or
@@ -1517,7 +1523,7 @@ fbsd_nat_target::stopped_by_sw_breakpoint ()
sizeof pl) == -1)
return false;
- return ((pl.pl_flags & PL_FLAG_SI)
+ return (pl.pl_flags == PL_FLAG_SI
&& pl.pl_siginfo.si_signo == SIGTRAP
&& pl.pl_siginfo.si_code == TRAP_BRKPT);
}