* coredep.c: Renamed to core-aout.c
authorFred Fish <fnf@specifix.com>
Thu, 11 Jan 1996 20:08:15 +0000 (20:08 +0000)
committerFred Fish <fnf@specifix.com>
Thu, 11 Jan 1996 20:08:15 +0000 (20:08 +0000)
* 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.

58 files changed:
gdb/.Sanitize
gdb/ChangeLog
gdb/Makefile.in
gdb/TODO
gdb/a68v-nat.c
gdb/alpha-nat.c
gdb/config/i386/i386bsd.mh
gdb/config/i386/i386dgux.mh
gdb/config/i386/i386m3.mh
gdb/config/i386/i386v32.mh
gdb/config/i386/nbsd.mh
gdb/config/i386/ptx.mh
gdb/config/i386/ptx4.mh
gdb/config/i386/symmetry.mh
gdb/config/m68k/3b1.mh
gdb/config/m68k/delta68.mh
gdb/config/m68k/dpx2.mh
gdb/config/m68k/hp300bsd.mh
gdb/config/m68k/hp300hpux.mh
gdb/config/m68k/isi.mh
gdb/config/m68k/m68kv4.mh
gdb/config/m68k/news.mh
gdb/config/m68k/news1000.mh
gdb/config/m88k/cxux.mh
gdb/config/m88k/delta88.mh
gdb/config/m88k/delta88v4.mh
gdb/config/mips/littlemips.mh
gdb/config/mips/mipsm3.mh
gdb/config/mips/mipsv4.mh
gdb/config/ns32k/merlin.mh
gdb/config/ns32k/nbsd.mh
gdb/config/ns32k/ns32km3.mh
gdb/config/pa/hppabsd.mh
gdb/config/pa/hppahpux.mh
gdb/config/vax/vaxbsd.mh
gdb/config/vax/vaxult.mh
gdb/config/vax/vaxult2.mh
gdb/core-aout.c [new file with mode: 0644]
gdb/core-regset.c [new file with mode: 0644]
gdb/core-sol2.c
gdb/core-svr4.c
gdb/coredep.c [deleted file]
gdb/corelow.c
gdb/doc/ChangeLog
gdb/hp300ux-nat.c
gdb/i386aix-nat.c
gdb/i386m3-nat.c
gdb/i386mach-nat.c
gdb/irix4-nat.c
gdb/irix5-nat.c
gdb/lynx-nat.c
gdb/mips-nat.c
gdb/ns32km3-nat.c
gdb/rs6000-nat.c
gdb/sparc-nat.c
gdb/sun3-nat.c
gdb/sun386-nat.c
gdb/ultra3-nat.c

index fae0475d59a81fb24e5faa05626a32958c4ac275..dca7747beefef177cb485205be8f05c41c35f9e5 100644 (file)
@@ -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
index 95f33b95bd412fa68789e3f87d524ce871ac2216..eea7d77ac0d621edee0eb3d06851a4af04167900 100644 (file)
@@ -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*.
index e82a0d2c228956df59b86d03a6eec3c4b83195c0..d03caf8a517e36afa4c7b41832eaf0dfbe95ab2c 100644 (file)
@@ -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
 
index f8abbcf5398909ced97d6917cdecaddfc5c86fff..06bd9acced09e910be056a88e17436513626b10b 100644 (file)
--- 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
index 9c39a25cb23b486bfbd909b60c104321b035445a..95bb3c83716bb2aee32adee8eec021f9a999ef2b 100644 (file)
@@ -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;
-{
-}
index 6e05781f8d21226339ac59a36a9eb7dd8c2b13a4..b027116804f6ab3a7188f1ea8011f886cd16b0af 100644 (file)
@@ -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
+
+\f
+/* 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);
+}
index 25156629db5fca529bee02f5c403ee60a2f4fc60..f95c6ed8b12a4cf7cecc91741fd993aebbb10f12 100644 (file)
@@ -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
index 91ef2bf8acbb7a50a139bc1f714fb4a015232f2c..bc2cee2af73ab142a0c56551f34d1381d8865ddc 100644 (file)
@@ -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
index 002cf438a2634562db13a60494af1061192882c5..66f984798cb33e9e96f3ccd32c0fe999e890bfcf 100644 (file)
@@ -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
index ada9736e83ab4fb766b30603f65a89b42afa90bb..5b4175fa08c4f45e8d6a388dc2029db7d9cfdbd7 100644 (file)
@@ -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
 
index 4357c2abaa546036b60e0bd41b66a6eb528429aa..de4ce4849113872470965b47a622a4d61c242b19 100644 (file)
@@ -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
index 256d2fa2a2fdd60f80cfbb3bdaf80be5cb13b643..e623538e156184be1a0b3ae56f48263e6094f2d8 100644 (file)
@@ -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
index 3a7c7400725089ada664f73059cb27797fa933ac..7b9d11b0c850b2f90de4a0db65deb9ef0475be53 100644 (file)
@@ -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
index d3db894bc38c55a48f13ba944f2a313a2aa81cf7..69c05bc1db313dab179ff6a1c4994fa2f814b0a2 100644 (file)
@@ -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
index fd484f7ce14f1e8fe6d727076b5c186cf1bb8aa0..2516ccedb5bc5569bf9beed874eced5867eb88de 100644 (file)
@@ -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
index 9a657addd5944f24423ff1cbc5f1ceeaeee4f84c..33aa702ba6b7b59fbac7f544fb841664ade0ddfc 100644 (file)
@@ -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
index 432e9b25141b02d170a168979358036791433ec3..e03bdce23a385c59a504b6cb058890dbd47c7cd4 100644 (file)
@@ -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
index 90b0ff29dcea80687ba34239f964191300bba9a1..3ca036250f8079040b30dc830051f698c68f8a9a 100644 (file)
@@ -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
index 9f4ca16cb5fb2b27f01a08ab9ef1d67501389d97..8ceb1872ca5efb86c6649b0937813d25286f8cd3 100644 (file)
@@ -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
index 3c498697717aac8d3bf77d97cdf990b0e49c1a7d..c406b4c51d86c56aa4034878e2f82a12b785337a 100644 (file)
@@ -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
index 9253f4d908c4b5917f3827b9ac67665e7b4b86d2..4e62bf72b5adb4b5c981198b2f83b9cf8647ea62 100644 (file)
@@ -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
index 9c8a1751c6e41ae982926a1ab10a922d25aafdde..e94af1886f9d23caa0e388f63ccb0c1bf3a5f6ee 100644 (file)
@@ -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 
index 0a03a899e01ebce12a94fd24f069434fb436f888..b1bf0a573c290f2888d99e75e5c445fe8d928909 100644 (file)
@@ -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
index b5dce1862d790c863c2db65d6d9670f3e1d2ebc3..4a0d8fd026b00ff96308944fea7e9918275c75bd 100644 (file)
@@ -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
index be69b639c71394f2950b43275985c3b9a6fff9e2..824967a61cdf23eb24626f403588a41365882234 100644 (file)
@@ -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
index c8410969fd8c41c66959120ba9885b90616f7dd9..82be8833236afebf738ea703363d1fa341b22607 100644 (file)
@@ -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
index 80c26788def4e1e7c1777a2ca3912ce1ed7e1706..103919d230e74fe1b360627448ff176693c1d0ab 100644 (file)
@@ -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
index fe7cbad2631302311d6c749908f3b82dfea0b823..77279bd8237acf529bfde84a1defad035221f13d 100644 (file)
@@ -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
index d6b328bd66a3c35ca4ef0d3a393501c256b17994..87cb7e4239326546042382c0b7b0b2a49a3ab186 100644 (file)
@@ -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
index eac5b6b7407aa3e78153b3cf1b2e805d45f7bf93..f9c3e7b8a6a3142519d19276a3f21bea65301353 100644 (file)
@@ -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
index aa34c1f59614accd01640dd959cdacfd8ba81d49..6e7e884642b3df0a151a1f3dd4657d610ee118f2 100644 (file)
@@ -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
index 4317b49ea8ef5d91df8d684a6ba2265f40f913ce..c1c88b63d53643503c7965627903c565c4b6e5d1 100644 (file)
@@ -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
index a3664623ac19ddddf21b2418889c6b49e70c4879..6afe57a9ec81ed4750181e71a640a1d20c52079b 100644 (file)
@@ -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
index 683c1d7df8e2751dfa57a8f21d9cd112514e1e19..6c566a63fc23ee2854b3e97f851b9521b3d71412 100644 (file)
@@ -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
index 842422b2802cd79bfe408366f5a2bdabc3f0bcf5..078687d29adc1cfe531781a2f1c6bd2457031361 100644 (file)
@@ -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
index 6d62ac96b48a4e7e77e08ad639ea0e0acd40db06..4afcbc85099fa6adc79f05fc4eccb5b9613546fb 100644 (file)
@@ -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
index bed7ec837fa04e7c111c63a60965f0ba7a9ecff1..dac73d63e0f0a1606651fcad88351a13d8b707d0 100644 (file)
@@ -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/core-aout.c b/gdb/core-aout.c
new file mode 100644 (file)
index 0000000..32eef96
--- /dev/null
@@ -0,0 +1,143 @@
+/* Extract registers from a "standard" core file, for GDB.
+   Copyright (C) 1988-1995  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.  */
+
+/* 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>
+#include <sys/param.h>
+#include "gdbcore.h"
+#include "value.h" /* For supply_register.  */
+#include "inferior.h" /* For ARCH_NUM_REGS. */
+
+/* These are needed on various systems to expand REGISTER_U_ADDR.  */
+#ifndef USG
+#include <sys/dir.h>
+#include <sys/file.h>
+#include "gdb_stat.h"
+#include <sys/user.h>
+#ifndef NO_PTRACE_H
+# ifdef PTRACE_IN_WRONG_PLACE
+#  include <ptrace.h>
+# else /* !PTRACE_IN_WRONG_PLACE */
+#  include <sys/ptrace.h>
+# endif /* !PTRACE_IN_WRONG_PLACE */
+#endif /* NO_PTRACE_H */
+#endif
+
+#ifndef CORE_REGISTER_ADDR
+#define CORE_REGISTER_ADDR(regno, regptr) register_addr(regno, regptr)
+#endif /* CORE_REGISTER_ADDR */
+
+#ifdef NEED_SYS_CORE_H
+#include <sys/core.h>
+#endif
+
+/* Extract the register values out of the core file and store
+   them where `read_register' will find them.
+
+   CORE_REG_SECT points to the register values themselves, read into memory.
+   CORE_REG_SIZE is the size of that area.
+   WHICH says which set of registers we are handling (0 = int, 2 = float
+         on machines where they are discontiguous).
+   REG_ADDR is the offset from u.u_ar0 to the register values relative to
+            core_reg_sect.  This is used with old-fashioned core files to
+           locate the registers in a large upage-plus-stack ".reg" section.
+           Original upage address X is at location core_reg_sect+x+reg_addr.
+ */
+
+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 reg_addr;
+{
+  register int regno;
+  register unsigned int addr;
+  int bad_reg = -1;
+  register reg_ptr = -reg_addr;                /* Original u.u_ar0 is -reg_addr. */
+  int numregs = ARCH_NUM_REGS;
+
+  /* If u.u_ar0 was an absolute address in the core file, relativize it now,
+     so we can use it as an offset into core_reg_sect.  When we're done,
+     "register 0" will be at core_reg_sect+reg_ptr, and we can use
+     CORE_REGISTER_ADDR to offset to the other registers.  If this is a modern
+     core file without a upage, reg_ptr will be zero and this is all a big
+     NOP.  */
+  if (reg_ptr > core_reg_size)
+    reg_ptr -= KERNEL_U_ADDR;
+
+  for (regno = 0; regno < numregs; regno++)
+    {
+      addr = CORE_REGISTER_ADDR (regno, reg_ptr);
+      if (addr >= core_reg_size) {
+       if (bad_reg < 0)
+         bad_reg = regno;
+      } else {
+       supply_register (regno, core_reg_sect + addr);
+      }
+    }
+  if (bad_reg >= 0)
+    {
+      error ("Register %s not found in core file.", reg_names[bad_reg]);
+    }
+}
+
+
+#ifdef REGISTER_U_ADDR
+
+/* Return the address in the core dump or inferior of register REGNO.
+   BLOCKEND is the address of the end of the user structure.  */
+
+unsigned int
+register_addr (regno, blockend)
+     int regno;
+     int blockend;
+{
+  int addr;
+
+  if (regno < 0 || regno >= ARCH_NUM_REGS)
+    error ("Invalid register number %d.", regno);
+
+  REGISTER_U_ADDR (addr, blockend, regno);
+
+  return addr;
+}
+
+#endif /* REGISTER_U_ADDR */
+
+\f
+/* 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 (file)
index 0000000..5e10996
--- /dev/null
@@ -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
+       }
+    }
+}
+
+\f
+/* 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);
+}
index e9cf7dc8fe55696152bf6cb94dc4e2676b87815e..5f43002edb9ac7d3e501bcd15d5291156af774a9 100644 (file)
@@ -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)
        }
     }
 }
+
+\f
+/* 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);
+}
index 47a5647e70140a798491a076199433ee9e347d0c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -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/coredep.c b/gdb/coredep.c
deleted file mode 100644 (file)
index 5a33a0a..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Extract registers from a "standard" core file, for GDB.
-   Copyright (C) 1988-1991  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.  */
-
-/* corefile.c is supposed to be the more machine-independent aspects of this;
-   this file is more machine-specific.  */
-
-#include "defs.h"
-#include <sys/types.h>
-#include <sys/param.h>
-#include "gdbcore.h"
-#include "value.h" /* For supply_register.  */
-#include "inferior.h" /* For ARCH_NUM_REGS. */
-
-/* These are needed on various systems to expand REGISTER_U_ADDR.  */
-#ifndef USG
-#include <sys/dir.h>
-#include <sys/file.h>
-#include "gdb_stat.h"
-#include <sys/user.h>
-#ifndef NO_PTRACE_H
-# ifdef PTRACE_IN_WRONG_PLACE
-#  include <ptrace.h>
-# else /* !PTRACE_IN_WRONG_PLACE */
-#  include <sys/ptrace.h>
-# endif /* !PTRACE_IN_WRONG_PLACE */
-#endif /* NO_PTRACE_H */
-#endif
-
-#ifndef CORE_REGISTER_ADDR
-#define CORE_REGISTER_ADDR(regno, regptr) register_addr(regno, regptr)
-#endif /* CORE_REGISTER_ADDR */
-
-#ifdef NEED_SYS_CORE_H
-#include <sys/core.h>
-#endif
-
-/* Extract the register values out of the core file and store
-   them where `read_register' will find them.
-
-   CORE_REG_SECT points to the register values themselves, read into memory.
-   CORE_REG_SIZE is the size of that area.
-   WHICH says which set of registers we are handling (0 = int, 2 = float
-         on machines where they are discontiguous).
-   REG_ADDR is the offset from u.u_ar0 to the register values relative to
-            core_reg_sect.  This is used with old-fashioned core files to
-           locate the registers in a large upage-plus-stack ".reg" section.
-           Original upage address X is at location core_reg_sect+x+reg_addr.
- */
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
-     char *core_reg_sect;
-     unsigned core_reg_size;
-     int which;
-     unsigned reg_addr;
-{
-  register int regno;
-  register unsigned int addr;
-  int bad_reg = -1;
-  register reg_ptr = -reg_addr;                /* Original u.u_ar0 is -reg_addr. */
-  int numregs = ARCH_NUM_REGS;
-
-  /* If u.u_ar0 was an absolute address in the core file, relativize it now,
-     so we can use it as an offset into core_reg_sect.  When we're done,
-     "register 0" will be at core_reg_sect+reg_ptr, and we can use
-     CORE_REGISTER_ADDR to offset to the other registers.  If this is a modern
-     core file without a upage, reg_ptr will be zero and this is all a big
-     NOP.  */
-  if (reg_ptr > core_reg_size)
-    reg_ptr -= KERNEL_U_ADDR;
-
-  for (regno = 0; regno < numregs; regno++)
-    {
-      addr = CORE_REGISTER_ADDR (regno, reg_ptr);
-      if (addr >= core_reg_size) {
-       if (bad_reg < 0)
-         bad_reg = regno;
-      } else {
-       supply_register (regno, core_reg_sect + addr);
-      }
-    }
-  if (bad_reg >= 0)
-    {
-      error ("Register %s not found in core file.", reg_names[bad_reg]);
-    }
-}
-
-
-#ifdef REGISTER_U_ADDR
-
-/* Return the address in the core dump or inferior of register REGNO.
-   BLOCKEND is the address of the end of the user structure.  */
-
-unsigned int
-register_addr (regno, blockend)
-     int regno;
-     int blockend;
-{
-  int addr;
-
-  if (regno < 0 || regno >= ARCH_NUM_REGS)
-    error ("Invalid register number %d.", regno);
-
-  REGISTER_U_ADDR (addr, blockend, regno);
-
-  return addr;
-}
-
-#endif /* REGISTER_U_ADDR */
index d9370574f564a7bb88641e00c33581d65cd0280d..d0626c3aec17dc1b535bee2f65b4f3301147bfdc 100644 (file)
@@ -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
        {
index bb669f66b73db0c6621c5a4b2572e4acdeca1f70..b63744863db48ebd7d54b43f872276681430a730 100644 (file)
@@ -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
index 6bd1f4e21cf1d10079fdd3e79db10d42b6e53bb2..af8d098d014a319ed83651ff8f3c79434cb94385 100644 (file)
@@ -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;
 }
+
+\f
+/* 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);
+}
index 2c02ef7cf69a807faaefdbdb08f1af9e21147bf1..133109e653ec00dcee3ced328e92ba15707c7392 100644 (file)
@@ -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");
     }
 }
+
+\f
+/* 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);
+}
index 9d0cfd127dce864112ab1cfdbc4df14b52846345..bbaa022f3fada2e6fdc94f01ff51503a23a90233 100644 (file)
@@ -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
index f1096dc8cf629754b0049c096102faad1460df2a..1a5904a13078f4d15e4e67b843db997d71e37b8b 100644 (file)
@@ -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;
   }
 }
+
+\f
+/* 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);
+}
index 3141f105df2855b9774bc1a9f1cd15cafd2c5c88..babd143c7a8ec248653e368c6cd6ce05aa067b56 100644 (file)
@@ -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);
 }
+
+\f
+/* 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);
+}
index 72ce3051429355e7274e14a17d3e10745be79ed2..1be5d4d829a75250da93d6938ca4163e74680275 100644 (file)
@@ -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);
 }
+
+\f
+/* 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);
+}
index b04080143eef5c8e81be92ab5f063808222379d2..aec00ed527b06bcad06c06fd521d910310ba65f0 100644 (file)
@@ -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
 }
+
+\f
+/* 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);
+}
index 43747c0aa89a591fd469d8717ea258867ce20dab..8d80af4e587a7383eaacd15b5d44f7df54728a18 100644 (file)
@@ -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;
 }
+
+\f
+/* 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);
+}
index 130c619a1de76e90472361e951ecd6bc90208898..89696ba0fcaba0e2ca8af1401069b2d53b2e7824 100644 (file)
@@ -68,18 +68,6 @@ static int reg_offset[] =
          &registers[REGISTER_BYTE (regnum)], \
          count*REGISTER_SIZE)
 \f
-/* 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");
-}
-\f
 /*
  * Fetch inferiors registers for gdb.
  * REGNO specifies which (as gdb views it) register, -1 for all.
index 436fa04793c7183e0c91b9abba1fe753f0caad0e..47bfe2d415085c33561e535b1872840c9e0b16fb 100644 (file)
@@ -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));
 }
 
+\f
+/* 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);
+}
index 7b072cf8f46f0569edcd808440d8619f182c6bcf..10c96a2ae505275882a0f3794d4b034f49f83e9a 100644 (file)
@@ -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));
 }
+
+\f
+/* 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);
+}
index baff3da93cbe417f4cd6f4fc1c489e3155734d3c..c2ab6c99a5016cd3d6d04aa27a204ea800ca3bfc 100644 (file)
@@ -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");
   }
 }
+
+\f
+/* 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);
+}
index fd9ca042cad8a7f523a243bf7b7c6d82c2b5253c..1abb4bb1df05a8ca1384dfd4a155ea0b315cbd71 100644 (file)
@@ -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);
 }
-
index d63614b0113b8faf263623edd589a659607a4734..d348c6f7cd35a39a6f54001d38d7d0ab0180641a 100644 (file)
@@ -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)
   }
 }
 
+\f
+/* 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);
+}
This page took 0.054028 seconds and 4 git commands to generate.