aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-01-11 20:08:15 +0000
committerFred Fish <fnf@specifix.com>1996-01-11 20:08:15 +0000
commita1df8e780c755671cb0c77272a1cc91155974183 (patch)
tree02f4a5691cff82531c79b209c586f62e4771d7d8
parente4ee6fb776172af7f902acda147814dad7cf8bf0 (diff)
downloadfsf-binutils-gdb-a1df8e780c755671cb0c77272a1cc91155974183.zip
fsf-binutils-gdb-a1df8e780c755671cb0c77272a1cc91155974183.tar.gz
fsf-binutils-gdb-a1df8e780c755671cb0c77272a1cc91155974183.tar.bz2
* coredep.c: Renamed to core-aout.c
* 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.
-rw-r--r--gdb/.Sanitize4
-rw-r--r--gdb/ChangeLog91
-rw-r--r--gdb/Makefile.in12
-rw-r--r--gdb/TODO2
-rw-r--r--gdb/a68v-nat.c9
-rw-r--r--gdb/alpha-nat.c18
-rw-r--r--gdb/config/i386/i386bsd.mh2
-rw-r--r--gdb/config/i386/i386dgux.mh2
-rw-r--r--gdb/config/i386/i386m3.mh2
-rw-r--r--gdb/config/i386/i386v32.mh2
-rw-r--r--gdb/config/i386/nbsd.mh2
-rw-r--r--gdb/config/i386/ptx.mh2
-rw-r--r--gdb/config/i386/ptx4.mh2
-rw-r--r--gdb/config/i386/symmetry.mh2
-rw-r--r--gdb/config/m68k/3b1.mh2
-rw-r--r--gdb/config/m68k/delta68.mh2
-rw-r--r--gdb/config/m68k/dpx2.mh2
-rw-r--r--gdb/config/m68k/hp300bsd.mh2
-rw-r--r--gdb/config/m68k/hp300hpux.mh2
-rw-r--r--gdb/config/m68k/isi.mh2
-rw-r--r--gdb/config/m68k/m68kv4.mh2
-rw-r--r--gdb/config/m68k/news.mh2
-rw-r--r--gdb/config/m68k/news1000.mh2
-rw-r--r--gdb/config/m88k/cxux.mh2
-rw-r--r--gdb/config/m88k/delta88.mh3
-rw-r--r--gdb/config/m88k/delta88v4.mh3
-rw-r--r--gdb/config/mips/littlemips.mh2
-rw-r--r--gdb/config/mips/mipsm3.mh2
-rw-r--r--gdb/config/mips/mipsv4.mh2
-rw-r--r--gdb/config/ns32k/merlin.mh2
-rw-r--r--gdb/config/ns32k/nbsd.mh2
-rw-r--r--gdb/config/ns32k/ns32km3.mh2
-rw-r--r--gdb/config/pa/hppabsd.mh2
-rw-r--r--gdb/config/pa/hppahpux.mh2
-rw-r--r--gdb/config/vax/vaxbsd.mh2
-rw-r--r--gdb/config/vax/vaxult.mh2
-rw-r--r--gdb/config/vax/vaxult2.mh2
-rw-r--r--gdb/core-aout.c (renamed from gdb/coredep.c)26
-rw-r--r--gdb/core-regset.c126
-rw-r--r--gdb/core-sol2.c20
-rw-r--r--gdb/core-svr4.c109
-rw-r--r--gdb/corelow.c59
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/hp300ux-nat.c19
-rw-r--r--gdb/i386aix-nat.c19
-rw-r--r--gdb/i386m3-nat.c2
-rw-r--r--gdb/i386mach-nat.c19
-rw-r--r--gdb/irix4-nat.c19
-rw-r--r--gdb/irix5-nat.c19
-rw-r--r--gdb/lynx-nat.c19
-rw-r--r--gdb/mips-nat.c19
-rw-r--r--gdb/ns32km3-nat.c12
-rw-r--r--gdb/rs6000-nat.c17
-rw-r--r--gdb/sparc-nat.c19
-rw-r--r--gdb/sun3-nat.c19
-rw-r--r--gdb/sun386-nat.c18
-rw-r--r--gdb/ultra3-nat.c17
57 files changed, 566 insertions, 216 deletions
diff --git a/gdb/.Sanitize b/gdb/.Sanitize
index fae0475..dca7747 100644
--- a/gdb/.Sanitize
+++ b/gdb/.Sanitize
@@ -139,10 +139,10 @@ convex-tdep.c
convex-xdep.c
copying.awk
copying.c
+core-aout.c
+core-regset.c
core-sol2.c
-core-svr4.c
corefile.c
-coredep.c
corelow.c
cp-valprint.c
cpu32bug-rom.c
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 95f33b9..eea7d77 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,94 @@
+Wed Jan 10 11:25:37 1996 Fred Fish <fnf@cygnus.com>
+
+ * coredep.c: Renamed to core-aout.c
+ * 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.
+
Wed Jan 10 16:08:49 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
* configure.in, configure: Recognize rs6000-*-aix4*.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index e82a0d2..d03caf8 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -875,9 +875,9 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
altos-xdep.c arm-convert.s \
arm-tdep.c arm-xdep.c coff-solib.c \
- convex-tdep.c \
- convex-xdep.c core-sol2.c core-svr4.c coredep.c corelow.c dcache.c \
- delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
+ convex-tdep.c convex-xdep.c \
+ core-sol2.c core-regset.c core-aout.c corelow.c \
+ dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
go32-xdep.c gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \
hpread.c \
@@ -1060,17 +1060,17 @@ convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
copying.o: copying.c $(defs_h) $(gdbcmd_h)
+core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h)
+
core-sol2.o: core-sol2.c $(command_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) target.h
-core-svr4.o: core-svr4.c $(command_h) $(defs_h) $(gdbcore_h) \
+core-regset.o: core-regset.c $(command_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) target.h
corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) target.h language.h
-coredep.o: coredep.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h)
-
corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
target.h thread.h
diff --git a/gdb/TODO b/gdb/TODO
index f8abbcf..06bd9ac 100644
--- a/gdb/TODO
+++ b/gdb/TODO
@@ -60,7 +60,7 @@ as unused statics functions.
Perhaps "i source" should take an argument like that of "list".
-See if coredep.c's fetch_core_registers can be used on more machines.
+See if core-aout.c's fetch_core_registers can be used on more machines.
E.g. MIPS (mips-xdep.c).
unpack_double() does not handle IEEE float on the target unless the host
diff --git a/gdb/a68v-nat.c b/gdb/a68v-nat.c
index 9c39a25..95bb3c8 100644
--- a/gdb/a68v-nat.c
+++ b/gdb/a68v-nat.c
@@ -121,12 +121,3 @@ store_inferior_registers (regno)
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k);
}
-
-/* Apollos don't dump cores */
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
-}
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 6e05781..b027116 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -73,7 +73,7 @@ get_longjmp_target (pc)
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -225,3 +225,19 @@ fill_fpregset (fpregsetp, regno)
}
}
#endif
+
+
+/* Register that we are able to handle alpha core file formats. */
+
+static struct core_fns alpha_core_fns =
+{
+ bfd_target_aout_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_alpha ()
+{
+ add_core_fns (&alpha_core_fns);
+}
diff --git a/gdb/config/i386/i386bsd.mh b/gdb/config/i386/i386bsd.mh
index 2515662..f95c6ed 100644
--- a/gdb/config/i386/i386bsd.mh
+++ b/gdb/config/i386/i386bsd.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-i386bsd.h
XDEPFILES=
NAT_FILE= nm-i386bsd.h
-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
diff --git a/gdb/config/i386/i386dgux.mh b/gdb/config/i386/i386dgux.mh
index 91ef2bf..bc2cee2 100644
--- a/gdb/config/i386/i386dgux.mh
+++ b/gdb/config/i386/i386dgux.mh
@@ -6,7 +6,7 @@ XDEPFILES= ser-tcp.o
XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386v4.h
-NATDEPFILES= corelow.o core-svr4.o solib.o procfs.o fork-child.o i386v4-nat.o
+NATDEPFILES= corelow.o core-regset.o solib.o procfs.o fork-child.o i386v4-nat.o
# SVR4 comes standard with terminfo, and in some implementations, the
# old termcap descriptions are incomplete. So ensure that we use the
diff --git a/gdb/config/i386/i386m3.mh b/gdb/config/i386/i386m3.mh
index 002cf43..66f9847 100644
--- a/gdb/config/i386/i386m3.mh
+++ b/gdb/config/i386/i386m3.mh
@@ -1,6 +1,6 @@
# Host: Intel 386 running Mach3
-XDEPFILES= i387-tdep.o coredep.o
+XDEPFILES= i387-tdep.o core-aout.o
NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o
NAT_CLIBS= -lmachid -lnetname -lmach
XM_FILE= xm-i386m3.h
diff --git a/gdb/config/i386/i386v32.mh b/gdb/config/i386/i386v32.mh
index ada9736..5b4175f 100644
--- a/gdb/config/i386/i386v32.mh
+++ b/gdb/config/i386/i386v32.mh
@@ -5,5 +5,5 @@ XDEPFILES=
XM_CLIBS= -lPW
NAT_FILE= nm-i386v.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o i386v-nat.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o
diff --git a/gdb/config/i386/nbsd.mh b/gdb/config/i386/nbsd.mh
index 4357c2a..de4ce48 100644
--- a/gdb/config/i386/nbsd.mh
+++ b/gdb/config/i386/nbsd.mh
@@ -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
diff --git a/gdb/config/i386/ptx.mh b/gdb/config/i386/ptx.mh
index 256d2fa..e623538 100644
--- a/gdb/config/i386/ptx.mh
+++ b/gdb/config/i386/ptx.mh
@@ -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
diff --git a/gdb/config/i386/ptx4.mh b/gdb/config/i386/ptx4.mh
index 3a7c740..7b9d11b 100644
--- a/gdb/config/i386/ptx4.mh
+++ b/gdb/config/i386/ptx4.mh
@@ -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
diff --git a/gdb/config/i386/symmetry.mh b/gdb/config/i386/symmetry.mh
index d3db894..69c05bc 100644
--- a/gdb/config/i386/symmetry.mh
+++ b/gdb/config/i386/symmetry.mh
@@ -2,4 +2,4 @@
XDEPFILES=
XM_FILE= xm-symmetry.h
NAT_FILE= nm-symmetry.h
-NATDEPFILES= inftarg.o fork-child.o coredep.o corelow.o symm-nat.o
+NATDEPFILES= inftarg.o fork-child.o corelow.o core-aout.o symm-nat.o
diff --git a/gdb/config/m68k/3b1.mh b/gdb/config/m68k/3b1.mh
index fd484f7..2516cce 100644
--- a/gdb/config/m68k/3b1.mh
+++ b/gdb/config/m68k/3b1.mh
@@ -8,5 +8,5 @@ CC= gcc -traditional
# know what works and what fails on the 3B1.
#PINSN_CC= cc
-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-3b1.h
diff --git a/gdb/config/m68k/delta68.mh b/gdb/config/m68k/delta68.mh
index 9a657ad..33aa702 100644
--- a/gdb/config/m68k/delta68.mh
+++ b/gdb/config/m68k/delta68.mh
@@ -3,4 +3,4 @@
XM_FILE= xm-delta68.h
NAT_FILE= nm-delta68.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o delta68-nat.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o delta68-nat.o
diff --git a/gdb/config/m68k/dpx2.mh b/gdb/config/m68k/dpx2.mh
index 432e9b2..e03bdce 100644
--- a/gdb/config/m68k/dpx2.mh
+++ b/gdb/config/m68k/dpx2.mh
@@ -4,6 +4,6 @@ XM_FILE= xm-dpx2.h
XDEPFILES=
NAT_FILE= nm-dpx2.h
-NATDEPFILES= infptrace.o coredep.o corelow.o inftarg.o dpx2-nat.o fork-child.o
+NATDEPFILES= infptrace.o corelow.o core-aout.o inftarg.o dpx2-nat.o fork-child.o
TERMCAP=-lcurses
diff --git a/gdb/config/m68k/hp300bsd.mh b/gdb/config/m68k/hp300bsd.mh
index 90b0ff2..3ca0362 100644
--- a/gdb/config/m68k/hp300bsd.mh
+++ b/gdb/config/m68k/hp300bsd.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-hp300bsd.h
XDEPFILES=
NAT_FILE= nm-hp300bsd.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
diff --git a/gdb/config/m68k/hp300hpux.mh b/gdb/config/m68k/hp300hpux.mh
index 9f4ca16..8ceb187 100644
--- a/gdb/config/m68k/hp300hpux.mh
+++ b/gdb/config/m68k/hp300hpux.mh
@@ -5,4 +5,4 @@
XM_FILE= xm-hp300hpux.h
NAT_FILE= nm-hp300hpux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o coredep.o corelow.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o corelow.o core-aout.o
diff --git a/gdb/config/m68k/isi.mh b/gdb/config/m68k/isi.mh
index 3c49869..c406b4c 100644
--- a/gdb/config/m68k/isi.mh
+++ b/gdb/config/m68k/isi.mh
@@ -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
diff --git a/gdb/config/m68k/m68kv4.mh b/gdb/config/m68k/m68kv4.mh
index 9253f4d..4e62bf7 100644
--- a/gdb/config/m68k/m68kv4.mh
+++ b/gdb/config/m68k/m68kv4.mh
@@ -4,7 +4,7 @@ XM_FILE= xm-m68kv4.h
XDEPFILES=
NAT_FILE= nm-sysv4.h
-NATDEPFILES= corelow.o core-svr4.o solib.o procfs.o fork-child.o
+NATDEPFILES= corelow.o core-regset.o solib.o procfs.o fork-child.o
# SVR4 comes standard with terminfo, and in some implementations, the
# old termcap descriptions are incomplete. So ensure that we use the
diff --git a/gdb/config/m68k/news.mh b/gdb/config/m68k/news.mh
index 9c8a175..e94af18 100644
--- a/gdb/config/m68k/news.mh
+++ b/gdb/config/m68k/news.mh
@@ -2,4 +2,4 @@
XDEPFILES= news-xdep.o
XM_FILE= xm-news.h
NAT_FILE= nm-news.h
-NATDEPFILES= inftarg.o fork-child.o coredep.o corelow.o infptrace.o
+NATDEPFILES= inftarg.o fork-child.o corelow.o core-aout.o infptrace.o
diff --git a/gdb/config/m68k/news1000.mh b/gdb/config/m68k/news1000.mh
index 0a03a89..b1bf0a5 100644
--- a/gdb/config/m68k/news1000.mh
+++ b/gdb/config/m68k/news1000.mh
@@ -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
diff --git a/gdb/config/m88k/cxux.mh b/gdb/config/m88k/cxux.mh
index b5dce18..4a0d8fd 100644
--- a/gdb/config/m88k/cxux.mh
+++ b/gdb/config/m88k/cxux.mh
@@ -4,7 +4,7 @@ XM_FILE= xm-cxux.h
XDEPFILES=
NAT_FILE= nm-cxux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o cxux-nat.o corelow.o coredep.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o cxux-nat.o corelow.o core-aout.o
MMALLOC=
MMALLOC_DISABLE= -DNO_MMALLOC
diff --git a/gdb/config/m88k/delta88.mh b/gdb/config/m88k/delta88.mh
index be69b63..824967a 100644
--- a/gdb/config/m88k/delta88.mh
+++ b/gdb/config/m88k/delta88.mh
@@ -4,5 +4,4 @@ XM_FILE= xm-delta88.h
XDEPFILES=
NAT_FILE= nm-m88k.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o \
- corelow.o coredep.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o corelow.o core-aout.o
diff --git a/gdb/config/m88k/delta88v4.mh b/gdb/config/m88k/delta88v4.mh
index c841096..82be883 100644
--- a/gdb/config/m88k/delta88v4.mh
+++ b/gdb/config/m88k/delta88v4.mh
@@ -4,5 +4,4 @@ XM_FILE= xm-delta88v4.h
XDEPFILES=
NAT_FILE= nm-delta88v4.h
-NATDEPFILES= fork-child.o m88k-nat.o corelow.o \
- core-svr4.o procfs.o solib.o
+NATDEPFILES= fork-child.o m88k-nat.o corelow.o core-regset.o procfs.o solib.o
diff --git a/gdb/config/mips/littlemips.mh b/gdb/config/mips/littlemips.mh
index 80c2678..103919d 100644
--- a/gdb/config/mips/littlemips.mh
+++ b/gdb/config/mips/littlemips.mh
@@ -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
diff --git a/gdb/config/mips/mipsm3.mh b/gdb/config/mips/mipsm3.mh
index fe7cbad..77279bd 100644
--- a/gdb/config/mips/mipsm3.mh
+++ b/gdb/config/mips/mipsm3.mh
@@ -1,7 +1,7 @@
# Host: Little endian MIPS machine such as pmax
# running Mach 3.0 operating system
-XDEPFILES= coredep.o
+XDEPFILES= core-aout.o
NATDEPFILES= mipsm3-nat.o m3-nat.o
XM_FILE= xm-mipsm3.h
NAT_FILE= ../nm-m3.h
diff --git a/gdb/config/mips/mipsv4.mh b/gdb/config/mips/mipsv4.mh
index d6b328b..87cb7e4 100644
--- a/gdb/config/mips/mipsv4.mh
+++ b/gdb/config/mips/mipsv4.mh
@@ -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
diff --git a/gdb/config/ns32k/merlin.mh b/gdb/config/ns32k/merlin.mh
index eac5b6b..f9c3e7b 100644
--- a/gdb/config/ns32k/merlin.mh
+++ b/gdb/config/ns32k/merlin.mh
@@ -1,5 +1,5 @@
# Host: Merlin running utek 2.1
-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-merlin.h
# FIXME: M_INSTALL is gone from the gdb makefile. If anyone cares
diff --git a/gdb/config/ns32k/nbsd.mh b/gdb/config/ns32k/nbsd.mh
index aa34c1f..6e7e884 100644
--- a/gdb/config/ns32k/nbsd.mh
+++ b/gdb/config/ns32k/nbsd.mh
@@ -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
diff --git a/gdb/config/ns32k/ns32km3.mh b/gdb/config/ns32k/ns32km3.mh
index 4317b49..c1c88b6 100644
--- a/gdb/config/ns32k/ns32km3.mh
+++ b/gdb/config/ns32k/ns32km3.mh
@@ -1,7 +1,7 @@
# Host: ns32k running Mach3
XDEPFILES=
-NATDEPFILES= m3-nat.o ns32km3-nat.o fork-child.o coredep.o corelow.o
+NATDEPFILES= m3-nat.o ns32km3-nat.o fork-child.o corelow.o core-aout.o
NAT_CLIBS= -L/usr/mach/lib -lnetname -lmachid -lmach
XM_FILE= xm-ns32km3.h
NAT_FILE= nm-m3.h
diff --git a/gdb/config/pa/hppabsd.mh b/gdb/config/pa/hppabsd.mh
index a366462..6afe57a 100644
--- a/gdb/config/pa/hppabsd.mh
+++ b/gdb/config/pa/hppabsd.mh
@@ -2,6 +2,6 @@
XDEPFILES= ser-tcp.o
XM_FILE= xm-hppab.h
NAT_FILE= nm-hppab.h
-NATDEPFILES= hppab-nat.o coredep.o corelow.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
+NATDEPFILES= hppab-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
GDBSERVER_DEPFILES= low-hppabsd.o
diff --git a/gdb/config/pa/hppahpux.mh b/gdb/config/pa/hppahpux.mh
index 683c1d7..6c566a6 100644
--- a/gdb/config/pa/hppahpux.mh
+++ b/gdb/config/pa/hppahpux.mh
@@ -6,6 +6,6 @@ XM_FILE= xm-hppah.h
XDEPFILES= ser-tcp.o
NAT_FILE= nm-hppah.h
-NATDEPFILES= hppah-nat.o coredep.o corelow.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
+NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
diff --git a/gdb/config/vax/vaxbsd.mh b/gdb/config/vax/vaxbsd.mh
index 842422b..078687d 100644
--- a/gdb/config/vax/vaxbsd.mh
+++ b/gdb/config/vax/vaxbsd.mh
@@ -8,6 +8,6 @@
#msg (but see comments in Makefile.dist about compiling with gcc).
XM_FILE= xm-vaxbsd.h
-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
NAT_FILE= nm-vax.h
diff --git a/gdb/config/vax/vaxult.mh b/gdb/config/vax/vaxult.mh
index 6d62ac9..4afcbc8 100644
--- a/gdb/config/vax/vaxult.mh
+++ b/gdb/config/vax/vaxult.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-vaxult.h
XDEPFILES=
NAT_FILE= nm-vax.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
diff --git a/gdb/config/vax/vaxult2.mh b/gdb/config/vax/vaxult2.mh
index bed7ec8..dac73d6 100644
--- a/gdb/config/vax/vaxult2.mh
+++ b/gdb/config/vax/vaxult2.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-vaxult2.h
XDEPFILES=
NAT_FILE= nm-vax.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o coredep.o corelow.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
diff --git a/gdb/coredep.c b/gdb/core-aout.c
index 5a33a0a..32eef96 100644
--- a/gdb/coredep.c
+++ b/gdb/core-aout.c
@@ -1,5 +1,5 @@
/* Extract registers from a "standard" core file, for GDB.
- Copyright (C) 1988-1991 Free Software Foundation, Inc.
+ Copyright (C) 1988-1995 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,8 +17,10 @@ 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. */
-/* corefile.c is supposed to be the more machine-independent aspects of this;
- this file is more machine-specific. */
+/* Typically used on systems that have a.out format executables.
+ corefile.c is supposed to contain the more machine-independent
+ aspects of reading registers from core files, while this file is
+ more machine specific. */
#include "defs.h"
#include <sys/types.h>
@@ -63,7 +65,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -123,3 +125,19 @@ register_addr (regno, blockend)
}
#endif /* REGISTER_U_ADDR */
+
+
+/* Register that we are able to handle aout (trad-core) file formats. */
+
+static struct core_fns aout_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_aout ()
+{
+ add_core_fns (&aout_core_fns);
+}
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
new file mode 100644
index 0000000..5e10996
--- /dev/null
+++ b/gdb/core-regset.c
@@ -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 (&regset_core_fns);
+}
diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c
index e9cf7dc..5f43002 100644
--- a/gdb/core-sol2.c
+++ b/gdb/core-sol2.c
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
an ELF executable and cores generated by programs that were
run under BCP (the part of Solaris which allows it to run SunOS4
a.out files).
- This file combines the core register fetching from core-svr4.c
+ This file combines the core register fetching from core-regset.c
and sparc-nat.c to be able to read both flavours. */
#include "defs.h"
@@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "command.h"
#include "gdbcore.h"
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -115,3 +115,19 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
}
}
}
+
+
+/* Register that we are able to handle solaris core file formats. */
+
+static struct core_fns solaris_core_fns =
+{
+ bfd_target_elf_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_solaris ()
+{
+ add_core_fns (&solaris_core_fns);
+}
diff --git a/gdb/core-svr4.c b/gdb/core-svr4.c
index 47a5647..e69de29 100644
--- a/gdb/core-svr4.c
+++ b/gdb/core-svr4.c
@@ -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
- }
- }
-}
diff --git a/gdb/corelow.c b/gdb/corelow.c
index d937057..d0626c3 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -32,6 +32,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "thread.h"
+/* List of all available core_fns. On gdb startup, each core file register
+ reader calls add_core_fns() to register information on each core format it
+ is prepared to read. */
+
+static struct core_fns *core_file_fns = NULL;
+
static void core_files_info PARAMS ((struct target_ops *));
#ifdef SOLIB_ADD
@@ -46,6 +52,20 @@ static void core_close PARAMS ((int));
static void get_core_registers PARAMS ((int));
+/* Link a new core_fns into the global core_file_fns list. Called on gdb
+ startup by the _initialize routine in each core file register reader, to
+ register information about each format the the reader is prepared to
+ handle. */
+
+void
+add_core_fns (cf)
+ struct core_fns *cf;
+{
+ cf -> next = core_file_fns;
+ core_file_fns = cf;
+}
+
+
/* Discard all vestiges of any previous core file and mark data and stack
spaces as empty. */
@@ -253,6 +273,15 @@ get_core_registers (regno)
unsigned size;
char *the_regs;
char secname[10];
+ enum bfd_flavour our_flavour = bfd_get_flavour (core_bfd);
+ struct core_fns *cf;
+
+ if (core_file_fns == NULL)
+ {
+ fprintf_filtered (gdb_stderr,
+ "Can't fetch registers from this type of core file\n");
+ return;
+ }
/* Thread support. If inferior_pid is non-zero, then we have found a core
file with threads (or multiple processes). In that case, we need to
@@ -270,10 +299,25 @@ get_core_registers (regno)
goto cant;
size = bfd_section_size (core_bfd, reg_sec);
the_regs = alloca (size);
- if (bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0, size))
+ /* Look for the core functions that match this flavor. Default to the
+ first one if nothing matches. */
+ for (cf = core_file_fns; cf != NULL; cf = cf -> next)
+ {
+ if (our_flavour == cf -> core_flavour)
+ {
+ break;
+ }
+ }
+ if (cf == NULL)
+ {
+ cf = core_file_fns;
+ }
+ if (cf != NULL &&
+ bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0, size) &&
+ cf -> core_read_registers != NULL)
{
- fetch_core_registers (the_regs, size, 0,
- (unsigned) bfd_section_vma (abfd,reg_sec));
+ (cf -> core_read_registers (the_regs, size, 0,
+ (unsigned) bfd_section_vma (abfd,reg_sec)));
}
else
{
@@ -289,11 +333,12 @@ cant:
{
size = bfd_section_size (core_bfd, reg_sec);
the_regs = alloca (size);
- if (bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0,
- size))
+ if (cf != NULL &&
+ bfd_get_section_contents (core_bfd, reg_sec, the_regs, (file_ptr)0, size) &&
+ cf -> core_read_registers != NULL)
{
- fetch_core_registers (the_regs, size, 2,
- (unsigned) bfd_section_vma (abfd,reg_sec));
+ (cf -> core_read_registers (the_regs, size, 2,
+ (unsigned) bfd_section_vma (abfd,reg_sec)));
}
else
{
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index bb669f6..b637448 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 10 14:16:37 1996 Fred Fish <fnf@fishpond.amigalib.com>
+
+ * gdbint.texinfo (Native): Document name change, coredep.c to
+ core-aout.c.
+
Wed Dec 13 12:35:28 1995 Ian Lance Taylor <ian@cygnus.com>
* stabs.texinfo (Include Files): Document the values the SunOS4
diff --git a/gdb/hp300ux-nat.c b/gdb/hp300ux-nat.c
index 6bd1f4e..af8d098 100644
--- a/gdb/hp300ux-nat.c
+++ b/gdb/hp300ux-nat.c
@@ -223,7 +223,7 @@ store_inferior_registers (regno)
#define e_PC e_regs[PC]
#endif /* HPUX_VERSION_5 */
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned int core_reg_size;
@@ -266,3 +266,20 @@ getpagesize ()
{
return 4096;
}
+
+
+/* Register that we are able to handle hp300ux core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns hp300ux_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_hp300ux ()
+{
+ add_core_fns (&hp300ux_core_fns);
+}
diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c
index 2c02ef7..133109e 100644
--- a/gdb/i386aix-nat.c
+++ b/gdb/i386aix-nat.c
@@ -312,7 +312,7 @@ static int core_regmap[] =
CD_DS, CD_ES, CD_FS, CD_GS,
};
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -341,3 +341,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
}
}
+
+
+/* Register that we are able to handle i386aix core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns i386aix_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_i386aix ()
+{
+ add_core_fns (&i386aix_core_fns);
+}
diff --git a/gdb/i386m3-nat.c b/gdb/i386m3-nat.c
index 9d0cfd1..bbaa022 100644
--- a/gdb/i386m3-nat.c
+++ b/gdb/i386m3-nat.c
@@ -216,7 +216,7 @@ store_inferior_registers (regno)
* core file. If your UX does something else, adapt the routine
* below to return the offset to the given register.
*
- * Called by coredep.c(fetch_core_registers)
+ * Called by core-aout.c(fetch_core_registers)
*/
unsigned int
diff --git a/gdb/i386mach-nat.c b/gdb/i386mach-nat.c
index f1096dc..1a5904a 100644
--- a/gdb/i386mach-nat.c
+++ b/gdb/i386mach-nat.c
@@ -113,7 +113,7 @@ store_inferior_registers (regno)
/* Work with core files, for GDB. */
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -144,3 +144,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
break;
}
}
+
+
+/* Register that we are able to handle i386mach core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns i386mach_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_i386mach ()
+{
+ add_core_fns (&i386mach_core_fns);
+}
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
index 3141f10..babd143 100644
--- a/gdb/irix4-nat.c
+++ b/gdb/irix4-nat.c
@@ -157,7 +157,7 @@ get_longjmp_target (pc)
return 1;
}
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -172,3 +172,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
memcpy ((char *)registers, core_reg_sect, core_reg_size);
}
+
+
+/* Register that we are able to handle irix4 core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns irix4_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_irix4 ()
+{
+ add_core_fns (&irix4_core_fns);
+}
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 72ce305..1be5d4d 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -159,7 +159,7 @@ get_longjmp_target (pc)
return 1;
}
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -1047,3 +1047,20 @@ must be loaded manually, using `sharedlibrary'.",
&setlist),
&showlist);
}
+
+
+/* Register that we are able to handle irix5 core file formats.
+ This really is bfd_target_unknown_flavour */
+
+static struct core_fns irix5_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_irix5 ()
+{
+ add_core_fns (&irix5_core_fns);
+}
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index b040801..aec00ed 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -796,7 +796,7 @@ lynx_pid_to_str (pid)
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -818,3 +818,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
fetch_inferior_registers (I0_REGNUM);
#endif
}
+
+
+/* Register that we are able to handle lynx core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns lynx_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_lynx ()
+{
+ add_core_fns (&lynx_core_fns);
+}
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index 43747c0..8d80af4 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -162,7 +162,7 @@ get_longjmp_target(pc)
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -223,3 +223,20 @@ register_addr (regno, blockend)
return addr;
}
+
+
+/* Register that we are able to handle mips core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns mips_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_mips ()
+{
+ add_core_fns (&mips_core_fns);
+}
diff --git a/gdb/ns32km3-nat.c b/gdb/ns32km3-nat.c
index 130c619..89696ba 100644
--- a/gdb/ns32km3-nat.c
+++ b/gdb/ns32km3-nat.c
@@ -68,18 +68,6 @@ static int reg_offset[] =
&registers[REGISTER_BYTE (regnum)], \
count*REGISTER_SIZE)
-/* 4.4 bfd support function */
-/* jtv@hut.fi: UNIMPLEMENTED!!!!! */
-
-void
-fetch_core_registers (core_regs, core_reg_size, which)
- char *core_regs;
- unsigned int core_reg_size;
- int which;
-{
- error ("Unimplemented routine fetch_core_registers called");
-}
-
/*
* Fetch inferiors registers for gdb.
* REGNO specifies which (as gdb views it) register, -1 for all.
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 436fa04..47bfe2d 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -249,7 +249,7 @@ exec_one_dummy_insn ()
target_remove_breakpoint (DUMMY_INSN_ADDR, shadow_contents);
}
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -794,3 +794,18 @@ kernel_u_size ()
return (sizeof (struct user));
}
+
+/* Register that we are able to handle rs6000 core file formats. */
+
+static struct core_fns rs6000_core_fns =
+{
+ bfd_target_coff_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_rs6000 ()
+{
+ add_core_fns (&rs6000_core_fns);
+}
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 7b072cf..10c96a2 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -238,7 +238,7 @@ store_inferior_registers (regno)
}
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
char *core_reg_sect;
unsigned core_reg_size;
@@ -301,3 +301,20 @@ kernel_u_size ()
{
return (sizeof (struct user));
}
+
+
+/* Register that we are able to handle sparc core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns sparc_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_sparc ()
+{
+ add_core_fns (&sparc_core_fns);
+}
diff --git a/gdb/sun3-nat.c b/gdb/sun3-nat.c
index baff3da..c2ab6c9 100644
--- a/gdb/sun3-nat.c
+++ b/gdb/sun3-nat.c
@@ -98,7 +98,7 @@ store_inferior_registers (regno)
/* All of this stuff is only relevant if both host and target are sun3. */
/* Machine-dependent code for pulling registers out of a Sun-3 core file. */
-void
+static void
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
char *core_reg_sect;
unsigned core_reg_size;
@@ -136,3 +136,20 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
}
}
+
+
+/* Register that we are able to handle sun3 core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns sun3_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+
+void
+_initialize_core_sun3 ()
+{
+ add_core_fns (&sun3_core_fns);
+}
diff --git a/gdb/sun386-nat.c b/gdb/sun386-nat.c
index fd9ca04..1abb4bb 100644
--- a/gdb/sun386-nat.c
+++ b/gdb/sun386-nat.c
@@ -19,8 +19,6 @@ 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. */
-#if defined (GDB_TARGET_IS_SUN386)
-
#include "defs.h"
#include "frame.h"
#include "inferior.h"
@@ -184,21 +182,6 @@ double_to_i387 (from, to)
asm ("fstpt (%eax)");
asm ("fwait");
}
-#else /* Not sun386 target. */
-
-/* These functions shouldn't be called when we're cross-debugging. */
-
-/* ARGSUSED */
-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 */
-{
-}
-
-#endif /* Not sun386 target. */
void
fetch_inferior_registers (regno)
@@ -273,4 +256,3 @@ store_inferior_registers (regno)
ptrace (PTRACE_SETFPREGS, inferior_pid,
(PTRACE_ARG3_TYPE) &inferior_fp_registers);
}
-
diff --git a/gdb/ultra3-nat.c b/gdb/ultra3-nat.c
index d63614b..d348c6f 100644
--- a/gdb/ultra3-nat.c
+++ b/gdb/ultra3-nat.c
@@ -241,7 +241,7 @@ fetch_register (regno)
* struct ptrace_user is the first thing in the core file
*/
-void
+static void
fetch_core_registers ()
{
register int regno;
@@ -305,4 +305,19 @@ register_addr (regno,blockend)
}
}
+
+/* Register that we are able to handle ultra3 core file formats.
+ FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns ultra3_core_fns =
+{
+ bfd_target_unknown_flavour,
+ fetch_core_registers,
+ NULL
+};
+void
+_initialize_core_ultra3 ()
+{
+ add_core_fns (&ultra3_core_fns);
+}