summaryrefslogtreecommitdiff
path: root/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
diff options
context:
space:
mode:
authorLuca Pizzamiglio <pizzamig@FreeBSD.org>2017-09-29 14:49:58 +0000
committerLuca Pizzamiglio <pizzamig@FreeBSD.org>2017-09-29 14:49:58 +0000
commitda0888d129352e814319d3bd80eba5e616c94c66 (patch)
tree7021557a285e972dcb234185a79c0e878643d4d7 /devel/gdb/files/patch-gdb_amd64-bsd-nat.c
parentbenchmarks/unixbench: Fix the new path in the unixbench (diff)
devel/gdb: Update to gdb 8.0.1
Resolve tons of warnings. Fix the type of literal string as char const * Fix Makefile's variables order and adding the license file Rework patches to make portlint happy Reviewed by: jhb Approved by: lme (mentor) Differential Revision: https://reviews.freebsd.org/D12525
Notes
Notes: svn path=/head/; revision=450895
Diffstat (limited to 'devel/gdb/files/patch-gdb_amd64-bsd-nat.c')
-rw-r--r--devel/gdb/files/patch-gdb_amd64-bsd-nat.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/devel/gdb/files/patch-gdb_amd64-bsd-nat.c b/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
new file mode 100644
index 000000000000..1f16ba316a40
--- /dev/null
+++ b/devel/gdb/files/patch-gdb_amd64-bsd-nat.c
@@ -0,0 +1,30 @@
+--- gdb/amd64-bsd-nat.c.orig 2017-09-14 09:28:17 UTC
++++ gdb/amd64-bsd-nat.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/ptrace.h>
+ #include <machine/reg.h>
++#include <machine/psl.h>
+
+ #include "amd64-tdep.h"
+ #include "amd64-nat.h"
+@@ -95,12 +96,19 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
+ if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
+ {
+ struct reg regs;
++ register_t old_rflags;
+
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+ perror_with_name (_("Couldn't get registers"));
+
++ old_rflags = regs.r_rflags;
+ amd64_collect_native_gregset (regcache, &regs, regnum);
+
++ /* This is a workaround about the PSL_USERCHANGE posix limitation. */
++ if ((regs.r_rflags ^ old_rflags ) & ~PSL_USERCHANGE)
++ {
++ regs.r_rflags ^= (regs.r_rflags ^ old_rflags ) & ~PSL_USERCHANGE;
++ }
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+ perror_with_name (_("Couldn't write registers"));
+