Hi,

 The generic ELF core handling functions in core-regset.c use gregset_t
and fpregset_t types to access registers.  Linux systems use elf_gregset_t
and elf_fpregset_t, though.  They have different sizes and layout.  While
host-specific files take this into account, core-regset.c does not.  As a
result it rejects registers from cores complaining of the size of the area
being incorrect.

 The following is a small update I successfully use.  I propose it for an
inclusion.  Alternatively, a new Linux-specific file might be created, but
that might unnecessarily complicate maintenance -- only type names differ
but files would have to be kept in sync forever.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [EMAIL PROTECTED], PGP key available        +

diff -u --recursive --new-file gdb-5.0.macro/gdb/configure.in gdb-5.0/gdb/configure.in
--- gdb-5.0.macro/gdb/configure.in      Thu May 11 00:32:18 2000
+++ gdb-5.0/gdb/configure.in    Thu Jun 15 10:12:57 2000
@@ -196,6 +196,8 @@
   BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
   BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
   BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
+  BFD_HAVE_SYS_PROCFS_TYPE(elf_gregset_t)
+  BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
   BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
   BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
   BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
diff -u --recursive --new-file gdb-5.0.macro/gdb/core-regset.c 
gdb-5.0/gdb/core-regset.c
--- gdb-5.0.macro/gdb/core-regset.c     Tue Oct  5 23:08:06 1999
+++ gdb-5.0/gdb/core-regset.c   Thu Jun 15 10:11:03 2000
@@ -48,6 +48,13 @@
 #include "command.h"
 #include "gdbcore.h"
 
+#if !defined(HAVE_ELF_GREGSET_T) && defined(HAVE_GREGSET_T)
+typedef gregset_t elf_gregset_t;
+#endif
+#if !defined(HAVE_ELF_FPREGSET_T) && defined(HAVE_FPREGSET_T)
+typedef fpregset_t elf_fpregset_t;
+#endif
+
 static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
 
 void _initialize_core_regset PARAMS ((void));
@@ -85,8 +92,8 @@
      CORE_ADDR reg_addr;       /* Unused in this version */
 {
 #if defined (HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T)
-  gregset_t gregset;
-  fpregset_t fpregset;
+  elf_gregset_t gregset;
+  elf_fpregset_t fpregset;
 
   if (which == 0)
     {

Reply via email to