pkgsrc/devel/gdbada/patches/patch-ag
shannonjr ee8e2eb093 Added patch correcting how program counter and stack pointer are
accessed. This is simular to fix added to devel/gdb6.
2005-04-12 10:13:36 +00:00

32 lines
1 KiB
Text

$NetBSD: patch-ag,v 1.1 2005/04/12 10:13:36 shannonjr Exp $
--- gdb/i386bsd-nat.c.orig 2003-01-16 02:46:34.000000000 -0700
+++ gdb/i386bsd-nat.c
@@ -150,6 +150,9 @@ fill_gregset (gregset_t *gregsetp, int r
}
#include "i387-tdep.h"
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
/* Fill GDB's register array with the floating-point register values
in *FPREGSETP. */
@@ -419,7 +422,7 @@ _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);
+ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_EIP]);
if (SC_PC_OFFSET != sc_pc_offset)
{
@@ -432,7 +435,7 @@ Please report this to <bug-gdb@gnu.org>.
SC_PC_OFFSET = sc_pc_offset;
/* Likewise for the stack pointer. */
- sc_sp_offset = offsetof (struct sigcontext, sc_sp);
+ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_UESP]);
if (SC_SP_OFFSET != sc_sp_offset)
{