gdb-4.16.85: Core file support for Digital Unix broken + fix

Peter.Schauer Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE
Mon Feb 9 12:07:00 GMT 1998


This change:

Mon Feb  2 17:18:25 1998  Richard Henderson  <rth@cygnus.com>

        * alpha-nat.c (fetch_aout_core_registers): Rename from
        fetch_core_registers.
        (fetch_elf_core_registers): New function.
		.
		.

breaks core file support on Digital Unix.
Digital Unix (a.k.a OSF) core files return a bfd_flavour of
bfd_target_unknown_flavour, not bfd_target_aout_flavour. This went unnoticed,
as get_core_registers defaults to the first flavour on the list if the
flavour doesn't match. With the addition of the elf flavour, the first
flavour on the list is elf, and GDB extracts the wrong register info for
DU core files.

Here is a fix:

Sun Feb  8 21:05:45 1998  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)

	* alpha-nat.c (fetch_osf_core_registers):  Renamed from
	fetch_aout_core_registers.
	(alpha_osf_core_fns):  Renamed from alpha_aout_core_fns, change
	flavour to bfd_target_unknown_flavour for OSF core files.

*** gdb-4.16.85/gdb/alpha-nat.c.orig	Tue Feb  3 02:20:08 1998
--- gdb-4.16.85/gdb/alpha-nat.c	Mon Feb  9 20:58:40 1998
***************
*** 1,5 ****
  /* Low level Alpha interface, for GDB when running native.
!    Copyright 1993, 1995, 1996 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
--- 1,5 ----
  /* Low level Alpha interface, for GDB when running native.
!    Copyright 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
***************
*** 30,36 ****
  #endif
  #include <sys/user.h>
  
! static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
  
  /* Size of elements in jmpbuf */
  
--- 30,39 ----
  #endif
  #include <sys/user.h>
  
! static void fetch_osf_core_registers PARAMS ((char *,
! 					      unsigned, int, CORE_ADDR));
! static void fetch_elf_core_registers PARAMS ((char *,
! 					      unsigned, int, CORE_ADDR));
  
  /* Size of elements in jmpbuf */
  
***************
*** 81,87 ****
   */
  
  static void
! fetch_aout_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
       char *core_reg_sect;
       unsigned core_reg_size;
       int which;
--- 84,90 ----
   */
  
  static void
! fetch_osf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
       char *core_reg_sect;
       unsigned core_reg_size;
       int which;
***************
*** 268,277 ****
  
  /* Register that we are able to handle alpha core file formats. */
  
! static struct core_fns alpha_aout_core_fns =
  {
!   bfd_target_aout_flavour,
!   fetch_aout_core_registers,
    NULL
  };
  
--- 271,282 ----
  
  /* Register that we are able to handle alpha core file formats. */
  
! static struct core_fns alpha_osf_core_fns =
  {
!   /* This really is bfd_target_unknown_flavour.  */
! 
!   bfd_target_unknown_flavour,
!   fetch_osf_core_registers,
    NULL
  };
  
***************
*** 285,290 ****
  void
  _initialize_core_alpha ()
  {
!   add_core_fns (&alpha_aout_core_fns);
    add_core_fns (&alpha_elf_core_fns);
  }
--- 290,295 ----
  void
  _initialize_core_alpha ()
  {
!   add_core_fns (&alpha_osf_core_fns);
    add_core_fns (&alpha_elf_core_fns);
  }

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de



More information about the Gdb mailing list