diff options
Diffstat (limited to 'devel/gdb/files/patch-gdb-amd64bsd-nat.c')
-rw-r--r-- | devel/gdb/files/patch-gdb-amd64bsd-nat.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/devel/gdb/files/patch-gdb-amd64bsd-nat.c b/devel/gdb/files/patch-gdb-amd64bsd-nat.c index 4ec19126faa1..7787a495e69c 100644 --- a/devel/gdb/files/patch-gdb-amd64bsd-nat.c +++ b/devel/gdb/files/patch-gdb-amd64bsd-nat.c @@ -1,7 +1,5 @@ -diff --git gdb/amd64bsd-nat.c gdb/amd64bsd-nat.c -index 66d4289..b1d4a0e 100644 ---- gdb/amd64bsd-nat.c -+++ gdb/amd64bsd-nat.c +--- gdb/amd64bsd-nat.c.orig 2016-02-10 04:19:39.000000000 +0100 ++++ gdb/amd64bsd-nat.c 2016-03-04 11:17:58.581638025 +0100 @@ -28,6 +28,7 @@ #include <sys/types.h> #include <sys/ptrace.h> @@ -10,7 +8,7 @@ index 66d4289..b1d4a0e 100644 #include "amd64-tdep.h" #include "amd64-nat.h" -@@ -98,14 +99,24 @@ amd64bsd_store_inferior_registers (struct target_ops *ops, +@@ -98,14 +99,25 @@ if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) { @@ -19,20 +17,21 @@ index 66d4289..b1d4a0e 100644 + memset( ®s, 0, sizeof(struct reg)); + memset( &oldregs, 0, sizeof(struct reg)); - if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), + if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); -+ ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), -+ (PTRACE_TYPE_ARG3) &oldregs, 0); ++ ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid), ++ (PTRACE_TYPE_ARG3) &oldregs, 0); amd64_collect_native_gregset (regcache, ®s, regnum); -+ if( (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE) { -+ //printf("regs.r_rflags = 0x%8.8lX\n", regs.r_rflags ); -+ //printf("oldregs.r_rflags = 0x%8.8lX\n", oldregs.r_rflags ); -+ regs.r_rflags ^= (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE; -+ //printf(" allowed regs.r_rflags = 0x%8.8X\n", regs.r_rflags ); -+ } - if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), ++ if( (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE) ++ { ++ //printf("regs.r_rflags = 0x%8.8lX\n", regs.r_rflags ); ++ //printf("oldregs.r_rflags = 0x%8.8lX\n", oldregs.r_rflags ); ++ regs.r_rflags ^= (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE; ++ //printf(" allowed regs.r_rflags = 0x%8.8X\n", regs.r_rflags ); ++ } + if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't write registers")); |