summaryrefslogtreecommitdiff
path: root/devel/gdb/patches/patch-am
diff options
context:
space:
mode:
Diffstat (limited to 'devel/gdb/patches/patch-am')
-rw-r--r--devel/gdb/patches/patch-am43
1 files changed, 41 insertions, 2 deletions
diff --git a/devel/gdb/patches/patch-am b/devel/gdb/patches/patch-am
index 7c164bf946f..fc851407170 100644
--- a/devel/gdb/patches/patch-am
+++ b/devel/gdb/patches/patch-am
@@ -1,6 +1,6 @@
-$NetBSD: patch-am,v 1.1 2006/02/27 15:45:29 joerg Exp $
+$NetBSD: patch-am,v 1.2 2007/07/11 13:12:01 lkundrak Exp $
---- gdb/i386bsd-nat.c.orig 2006-02-27 14:51:46.000000000 +0000
+--- gdb/i386bsd-nat.c.orig 2007-07-11 14:32:16.000000000 +0200
+++ gdb/i386bsd-nat.c
@@ -395,7 +395,7 @@ _initialize_i386bsd_nat (void)
system header files and sysctl(3) to get at the relevant
@@ -11,3 +11,42 @@ $NetBSD: patch-am,v 1.1 2006/02/27 15:45:29 joerg Exp $
extern int i386fbsd4_sc_pc_offset;
extern int i386fbsd4_sc_sp_offset;
#define SC_PC_OFFSET i386fbsd4_sc_pc_offset
+@@ -419,26 +419,30 @@ _initialize_i386bsd_nat (void)
+
+ /* Override the default value for the offset of the program counter
+ in the sigcontext structure. */
+- sc_pc_offset = offsetof (struct sigcontext, sc_pc);
++#if defined(__DragonFly__)
++ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.mc_eip);
++#else
++ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_EIP]);
++#endif
+
+ if (SC_PC_OFFSET != sc_pc_offset)
+ {
+- warning ("\
+-offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\
+-Please report this to <bug-gdb@gnu.org>.",
++ warning ("sc_pc_offset is %d instead of %d.",
+ sc_pc_offset, SC_PC_OFFSET);
+ }
+
+ SC_PC_OFFSET = sc_pc_offset;
+
+ /* Likewise for the stack pointer. */
+- sc_sp_offset = offsetof (struct sigcontext, sc_sp);
++#if defined(__DragonFly__)
++ sc_sp_offset = offsetof (ucontext_t, uc_mcontext.mc_esp);
++#else
++ sc_sp_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_UESP]);
++#endif
+
+ if (SC_SP_OFFSET != sc_sp_offset)
+ {
+- warning ("\
+-offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\
+-Please report this to <bug-gdb@gnu.org>.",
++ warning ("sc_sp_offset is %d instead of %d.",
+ sc_sp_offset, SC_SP_OFFSET);
+ }
+