This patch by kettenis@, pulled from base gdb, allows gdb to read registers from core files. I wonder why changes to other files in the same commit got upstreamed, but this one did not ...
Cheers, Pascal Index: Makefile =================================================================== RCS file: /cvs/ports/devel/gdb/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- Makefile 13 Nov 2011 14:56:57 -0000 1.18 +++ Makefile 15 Dec 2011 23:09:05 -0000 @@ -4,7 +4,7 @@ COMMENT= GNU debugger CATEGORIES= devel DISTNAME= gdb-7.2 -REVISION= 6 +REVISION= 7 HOMEPAGE= http://www.gnu.org/software/gdb/ Index: patches/patch-gdb_amd64obsd-tdep_c =================================================================== RCS file: patches/patch-gdb_amd64obsd-tdep_c diff -N patches/patch-gdb_amd64obsd-tdep_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gdb_amd64obsd-tdep_c 15 Dec 2011 23:09:05 -0000 @@ -0,0 +1,38 @@ +$OpenBSD$ +--- gdb/amd64obsd-tdep.c.orig Fri Jan 1 08:31:29 2010 ++++ gdb/amd64obsd-tdep.c Thu Dec 15 23:55:16 2011 +@@ -456,9 +456,6 @@ amd64obsd_init_abi (struct gdbarch_info info, struct g + tdep->gregset_num_regs = ARRAY_SIZE (amd64obsd_r_reg_offset); + tdep->sizeof_gregset = 24 * 8; + +- set_gdbarch_regset_from_core_section (gdbarch, +- amd64obsd_regset_from_core_section); +- + tdep->jb_pc_offset = 7 * 8; + + tdep->sigtramp_p = amd64obsd_sigtramp_p; +@@ -479,6 +476,17 @@ amd64obsd_init_abi (struct gdbarch_info info, struct g + } + + ++/* Traditional (a.out) NetBSD-style core dumps. */ ++ ++static void ++amd64obsd_core_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) ++{ ++ amd64obsd_init_abi (info, gdbarch); ++ ++ set_gdbarch_regset_from_core_section ++ (gdbarch, amd64obsd_regset_from_core_section); ++} ++ + /* Provide a prototype to silence -Wmissing-prototypes. */ + void _initialize_amd64obsd_tdep (void); + +@@ -493,5 +501,5 @@ _initialize_amd64obsd_tdep (void) + + /* OpenBSD uses traditional (a.out) NetBSD-style core dumps. */ + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, +- GDB_OSABI_NETBSD_AOUT, amd64obsd_init_abi); ++ GDB_OSABI_NETBSD_AOUT, amd64obsd_core_init_abi); + }