Browse Source
* core-svr4.c: Renamed to core-regset.c * Makefile.in (ALLDEPFILES): Account for renamings. * corelow.c (core_file_fns): Add, points to chain of structs. (add_core_fns): New function to build chain of structs. (get_core_registers): Modify to search core functions chain and call appropriate fetch_core_registers function based on core file flavour. * gdbcore.h (fetch_core_registers): Remove declaration. (struct core_fns): Define struct for core function info. * i386m3-nat.c: Update comment for filename change (coredep->core-aout) * a68v-nat.c (fetch_core_registers): Remove stub, not needed now. * alpha-nat.c (fetch_core_registers): Make static. (alpha_core_fns, _initialize_core_alpha): New struct and func. * core-aout.c (fetch_core_registers): Make static (aout_core_fns, _initialize_core_aout): New struct and func. * core-regset.c (fetch_core_registers): Make static. (regset_core_fns, _initialize_core_regset): New struct and func. * core-sol2.c (fetch_core_registers): Make static. (solaris_core_fns, _initialize_core_solaris): New struct and func. * hp300ux-nat.c (fetch_core_registers): Make static. (hp300ux_core_fns, _initialize_core_hp300ux): New struct and func. * i386aix-nat.c (fetch_core_registers): Make static. (i386aix_core_fns, _initialize_core_i386aix): New struct and func. * i386mach-nat.c (fetch_core_registers: Make static. (i386mach_core_fns, _initialize_core_i386mach): New struct and func. * irix4-nat.c (fetch_core_registers): Make static. (irix4_core_fns, _initialize_core_irix4): New struct and func. * irix5-nat.c (fetch_core_registers): (irix5_core_fns, _initialize_core_irix5): New struct and func. * lynx-nat.c (fetch_core_registers): Make static. (lynx_core_fns, _initialize_core_lynx): New struct and func. * mips-nat.c (fetch_core_registers): Make static. (mips_core_fns, _initialize_core_mips): New struct and func. * ns32km3-nat.c (fetch_core_registers): Remove stub. * rs6000-nat.c (fetch_core_registers): Make static. (rs6000_core_fns, _initialize_core_rs6000): New struct and func. * sparc-nat.c (fetch_core_registers): Make static. (sparc_core_fns, _initialize_core_sparc): New struct and func. * sun3-nat.c (fetch_core_registers): (sun3_core_fns, _initialize_core_sun3): New struct and func. * sun386-nat.c (fetch_core_registers): Remove stub. * ultra3-nat.c (fetch_core_registers): Make static. (ultra3_core_fns, _initialize_core_ultra3): New struct and func. * config/gould/pn.mh (XDEPFILES), config/i386/fbsd.mh (NATDEPFILES), config/i386/i386bsd.mh (NATDEPFILES), config/i386/i386m3.mh (XDEPFILES), config/i386/i386sco.mh (NATDEPFILES), config/i386/i386sco4.mh (NATDEPFILES), config/i386/i386v.mh (NATDEPFILES), config/i386/i386v32.mh (NATDEPFILES), config/i386/nbsd.mh (NATDEPFILES), config/i386/ptx.mh (XDEPFILES), config/i386/ptx4.mh (XDEPFILES), config/i386/symmetry.mh (NATDEPFILES), config/m68k/3b1.mh (XDEPFILES), config/m68k/cisco.mt (TDEPFILES), config/m68k/delta68.mh (NATDEPFILES), config/m68k/dpx2.mh (NATDEPFILES), config/m68k/hp300bsd.mh (NATDEPFILES), config/m68k/hp300hpux.mh (NATDEPFILES), config/m68k/isi.mh (XDEPFILES), config/m68k/news.mh (NATDEPFILES), config/m68k/news1000.mh (XDEPFILES), config/m88k/cxux.mh (NATDEPFILES), config/m88k/delta88.mh (NATDEPFILES), config/mips/littlemips.mh (XDEPFILES), config/mips/mipsm3.mh (XDEPFILES), config/ns32k/merlin.mh (XDEPFILES), config/ns32k/nbsd.mh (NATDEPFILES), config/ns32k/ns32km3.mh (NATDEPFILES), config/pa/hppabsd.mh (NATDEPFILES), config/pa/hppahpux.mh (NATDEPFILES), config/romp/rtbsd.mh (XDEPFILES), config/tahoe/tahoe.mh (XDEPFILES), config/vax/vaxbsd.mh (XDEPFILES), config/vax/vaxult.mh (NATDEPFILES), config/vax/vaxult2.mh (NATDEPFILES), Account for coredep.o to core-aout.o name change. * config/i386/i386dgux (NATDEPFILES), config/i386/i386sol2.mh (NATDEPFILES), config/i386/i386v4.mh (NATDEPFILES), config/i386/linux.mh (NATDEPFILES), config/i386/ncr3000.mh (NATDEPFILES), config/m68k/m68kv4.mh (NATDEPFILES), config/m88k/delta88v4.mh (NATDEPFILES), config/mips/mipsv4.mh (NATDEPFILES), Account for core-svr4.o to core-regset.o name change.gdb-4_18-branch
57 changed files with 566 additions and 216 deletions
@ -1,5 +1,5 @@ |
|||
# Host: Intel 386 running NetBSD |
|||
XDEPFILES= |
|||
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o coredep.o i386b-nat.o |
|||
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o |
|||
XM_FILE= xm-nbsd.h |
|||
NAT_FILE= nm-nbsd.h |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387 |
|||
|
|||
XM_FILE= xm-ptx.h |
|||
XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o coredep.o |
|||
XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o |
|||
XM_CLIBS= -lPW -lseq |
|||
|
|||
NAT_FILE= nm-symmetry.h |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387 |
|||
|
|||
XM_FILE= xm-ptx4.h |
|||
XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o coredep.o solib.o core-svr4.o |
|||
XDEPFILES= inftarg.o fork-child.o symm-nat.o corelow.o core-aout.o solib.o core-regset.o |
|||
XM_CLIBS= -lseq |
|||
|
|||
NAT_FILE= nm-ptx4.h |
|||
|
|||
@ -1,5 +1,5 @@ |
|||
# Host: ISI Optimum V (3.05) under 4.3bsd. |
|||
# corelow.o commented out because core dumps are broken on this machine, |
|||
# as of GDB 4.8, according to lam@tfs.com |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o isi-xdep.o |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o core-aout.o isi-xdep.o |
|||
XM_FILE= xm-isi.h |
|||
|
|||
@ -1,3 +1,3 @@ |
|||
# Host: Sony news series 1000 (68030) running NewsOS version 3. |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o news-xdep.o |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o news-xdep.o |
|||
XM_FILE= xm-news1000.h |
|||
|
|||
@ -1,3 +1,3 @@ |
|||
# Host: Little-endian MIPS machine such as DECstation. |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o |
|||
XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o |
|||
XM_FILE= xm-mips.h |
|||
|
|||
@ -1,4 +1,4 @@ |
|||
# Host: Mips running SVR4 |
|||
XM_FILE= xm-mipsv4.h |
|||
NAT_FILE= ../nm-sysv4.h |
|||
NATDEPFILES= fork-child.o procfs.o mipsv4-nat.o corelow.o core-svr4.o solib.o |
|||
NATDEPFILES= fork-child.o procfs.o mipsv4-nat.o corelow.o core-regset.o solib.o |
|||
|
|||
@ -1,4 +1,4 @@ |
|||
# Host: PC532 running NetBSD |
|||
XM_FILE= xm-nbsd.h |
|||
NAT_FILE= nm-nbsd.h |
|||
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o coredep.o ns32k-nat.o |
|||
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o ns32k-nat.o |
|||
|
|||
@ -0,0 +1,126 @@ |
|||
/* Machine independent GDB support for core files on systems using "regsets".
|
|||
Copyright 1993-1996 Free Software Foundation, Inc. |
|||
|
|||
This file is part of GDB. |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
|||
|
|||
|
|||
/* N O T E S
|
|||
|
|||
This file is used by most systems that implement /proc. For these systems, |
|||
the general registers are laid out the same way in both the core file and |
|||
the gregset_p structure. The current exception to this is Irix-4.*, where |
|||
the gregset_p structure is split up into two pieces in the core file. |
|||
|
|||
The general register and floating point register sets are manipulated by |
|||
separate ioctl's. This file makes the assumption that if FP0_REGNUM is |
|||
defined, then support for the floating point register set is desired, |
|||
regardless of whether or not the actual target has floating point hardware. |
|||
|
|||
*/ |
|||
|
|||
#include "defs.h" |
|||
|
|||
#include <time.h> |
|||
#include <sys/procfs.h> |
|||
#include <fcntl.h> |
|||
#include <errno.h> |
|||
#include "gdb_string.h" |
|||
|
|||
#include "inferior.h" |
|||
#include "target.h" |
|||
#include "command.h" |
|||
#include "gdbcore.h" |
|||
|
|||
/*
|
|||
|
|||
GLOBAL FUNCTION |
|||
|
|||
fetch_core_registers -- fetch current registers from core file |
|||
|
|||
SYNOPSIS |
|||
|
|||
void fetch_core_registers (char *core_reg_sect, |
|||
unsigned core_reg_size, |
|||
int which, unsigned in reg_addr) |
|||
|
|||
DESCRIPTION |
|||
|
|||
Read the values of either the general register set (WHICH equals 0) |
|||
or the floating point register set (WHICH equals 2) from the core |
|||
file data (pointed to by CORE_REG_SECT), and update gdb's idea of |
|||
their current values. The CORE_REG_SIZE parameter is ignored. |
|||
|
|||
NOTES |
|||
|
|||
Use the indicated sizes to validate the gregset and fpregset |
|||
structures. |
|||
*/ |
|||
|
|||
static void |
|||
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) |
|||
char *core_reg_sect; |
|||
unsigned core_reg_size; |
|||
int which; |
|||
unsigned int reg_addr; /* Unused in this version */ |
|||
{ |
|||
gregset_t gregset; |
|||
fpregset_t fpregset; |
|||
|
|||
if (which == 0) |
|||
{ |
|||
if (core_reg_size != sizeof (gregset)) |
|||
{ |
|||
warning ("wrong size gregset struct in core file"); |
|||
} |
|||
else |
|||
{ |
|||
memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset)); |
|||
supply_gregset (&gregset); |
|||
} |
|||
} |
|||
else if (which == 2) |
|||
{ |
|||
if (core_reg_size != sizeof (fpregset)) |
|||
{ |
|||
warning ("wrong size fpregset struct in core file"); |
|||
} |
|||
else |
|||
{ |
|||
memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset)); |
|||
#if defined (FP0_REGNUM) |
|||
supply_fpregset (&fpregset); |
|||
#endif |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
/* Register that we are able to handle ELF file formats using standard
|
|||
procfs "regset" structures. */ |
|||
|
|||
static struct core_fns regset_core_fns = |
|||
{ |
|||
bfd_target_elf_flavour, |
|||
fetch_core_registers, |
|||
NULL |
|||
}; |
|||
|
|||
void |
|||
_initialize_core_regset () |
|||
{ |
|||
add_core_fns (®set_core_fns); |
|||
} |
|||
@ -1,109 +0,0 @@ |
|||
/* Machine independent support for SVR4 core files for GDB.
|
|||
Copyright 1993 Free Software Foundation, Inc. |
|||
|
|||
This file is part of GDB. |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
|||
|
|||
|
|||
/* N O T E S
|
|||
|
|||
This version of fetch_core_registers() is used by most systems that |
|||
implement /proc. For these systems, the general registers are laid out |
|||
the same way in both the core file and the gregset_p structure. The |
|||
current exception to this is Irix-4.*, where the gregset_p structure is |
|||
split up into two pieces in the core file. |
|||
|
|||
The general register and floating point register sets are manipulated by |
|||
separate ioctl's. This file makes the assumption that if FP0_REGNUM is |
|||
defined, then support for the floating point register set is desired, |
|||
regardless of whether or not the actual target has floating point hardware. |
|||
|
|||
*/ |
|||
|
|||
#include "defs.h" |
|||
|
|||
#include <time.h> |
|||
#include <sys/procfs.h> |
|||
#include <fcntl.h> |
|||
#include <errno.h> |
|||
#include "gdb_string.h" |
|||
|
|||
#include "inferior.h" |
|||
#include "target.h" |
|||
#include "command.h" |
|||
#include "gdbcore.h" |
|||
|
|||
/*
|
|||
|
|||
GLOBAL FUNCTION |
|||
|
|||
fetch_core_registers -- fetch current registers from core file data |
|||
|
|||
SYNOPSIS |
|||
|
|||
void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, |
|||
int which, unsigned in reg_addr) |
|||
|
|||
DESCRIPTION |
|||
|
|||
Read the values of either the general register set (WHICH equals 0) |
|||
or the floating point register set (WHICH equals 2) from the core |
|||
file data (pointed to by CORE_REG_SECT), and update gdb's idea of |
|||
their current values. The CORE_REG_SIZE parameter is ignored. |
|||
|
|||
NOTES |
|||
|
|||
Use the indicated sizes to validate the gregset and fpregset |
|||
structures. |
|||
*/ |
|||
|
|||
void |
|||
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) |
|||
char *core_reg_sect; |
|||
unsigned core_reg_size; |
|||
int which; |
|||
unsigned int reg_addr; /* Unused in this version */ |
|||
{ |
|||
gregset_t gregset; |
|||
fpregset_t fpregset; |
|||
|
|||
if (which == 0) |
|||
{ |
|||
if (core_reg_size != sizeof (gregset)) |
|||
{ |
|||
warning ("wrong size gregset struct in core file"); |
|||
} |
|||
else |
|||
{ |
|||
memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset)); |
|||
supply_gregset (&gregset); |
|||
} |
|||
} |
|||
else if (which == 2) |
|||
{ |
|||
if (core_reg_size != sizeof (fpregset)) |
|||
{ |
|||
warning ("wrong size fpregset struct in core file"); |
|||
} |
|||
else |
|||
{ |
|||
memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset)); |
|||
#if defined (FP0_REGNUM) |
|||
supply_fpregset (&fpregset); |
|||
#endif |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue